Last modified date?

Kennyties
Kennyties
Community Member

Hello all,

I have a need to check the last modified date for all shared vaults to update a set of passwords on a 30 day schedule. I have pulled from shared vaults in the past and filtered on fields however I am not sure how to filter on the last modified date. Any ideas?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • ag_yaron
    ag_yaron
    1Password Alumni

    Hey @Kennyties ,

    When you use op get item xxxxx you will see that one of the first things in the list of info it shows you is the updatedAt variable, which is structured like so: 2021-03-16T08:09:04Z.

    You can compare the updatedAt variable of every item in any vault with a specific date/time in your script, and if the last updated date is earlier than what the script requires, execute whichever commands you need to change the password.

  • Kennyties
    Kennyties
    Community Member

    Thanks @ag_yaron,

    So what you are saying is use op get item without any filter fields?

  • ag_yaron
    ag_yaron
    1Password Alumni

    Yes @Kennyties ,

    If you fetch an entire item and not a specific field, you'll get its metadata as well. Then, you can parse it in your script and check the last update date and do what you will with it :)

  • Kennyties
    Kennyties
    Community Member

    Thanks!

  • ag_yaron
    ag_yaron
    1Password Alumni

    Glad I could help :+1:

  • Kennyties
    Kennyties
    Community Member

    Hey @ag_yaron just a quick update on this, I hit a few roadblocks on this but then I was reminded that I was not converting my request from JSON. So I created a variable to run on all share vaults and converted to JSON and then did $variablename.lastmodified to call the password.
    Completely unrelated is there any plans to implement a code option in the forum here? It would be super helpful.

  • ag_ana
    ag_ana
    1Password Alumni
    edited March 2021

    @Kennyties:

    Completely unrelated is there any plans to implement a code option in the forum here? It would be super helpful.

    Edit:

    You can already do this with a triple "`" character, so like this: "```" at the beginning and end of your code. Please see here an example.

  • Kennyties
    Kennyties
    Community Member

    Thanks @ag_ana that is super helpful!

  • ag_ana
    ag_ana
    1Password Alumni

    You are very welcome @Kennyties, I am glad I could help :)

This discussion has been closed.