How do I access a User entity's properties (set via API)?

Hi! I love Code Barrel's Automation plugin.

Now, I can set user properties via API:

curl -D- -d'"VIP User"' -u admin:<password> -X PUT -H "Content-Type: application/json" https://<My JIRA Cloud>.atlassian.net/rest/api/2/user/properties/vip?username=admin

And I can similarly retrieve them:

curl -D- -u admin:<password> -X GET https://<My JIRA Cloud>.atlassian.net/rest/api/2/user/properties/vip?username=admin

 

In the Automation plugin, I can retrieve many Reporter's details, eg., if the Reporter is admin, then I can set the Reporter Username custom field this way:

{
    "fields": {
        "Reporter Username": "{{issue.reporter.name}}"
    }
}


It makes sense to me that this should work, to set a VIP User custom field:

{

    "fields": {
        "VIP User": "{{issue.reporter.properties.vip}}"
    }
}

However this doesn't work. How do I access the "vip" property I set on the user entity in the JIRA Automation plugin?

2 answers

1 accepted

2 votes
Nick Menere Community Champion Aug 06, 2017

This can be done with the simple format:

{{issue.reporter.properties.vip}}

 

If you area trying to access the properties that are set via UI in user managgement (these are not entity properties but rather a legacy feature in JIRA) you can do the follwoing in Server only:

{{issue.reporter.legacyProperties.vip}}

 

Cheers,

Nick

2 votes
Nick Menere Community Champion Dec 16, 2016

Hi Alex,

Unfortunately this can't be done yet, though it something we will DEFINITELY add - https://codebarrel.atlassian.net/browse/AUT-83

It would really help a lot of use-cases. Watch the issue and we will try to get to it soon.

 

Cheers,

Nick

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

777 views 5 17
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot