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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

769 views 3 11
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