Last modified date?

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_yaronag_yaron

    Team Member

    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.

  • Thanks @ag_yaron,

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

  • ag_yaronag_yaron

    Team Member

    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 :)

  • Thanks!

  • ag_yaronag_yaron

    Team Member

    Glad I could help :+1:

  • 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_anaag_ana

    Team Member
    edited March 26

    @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.

  • Thanks @ag_ana that is super helpful!

  • ag_anaag_ana

    Team Member

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

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file