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
Accepted answer
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
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

21 views 2 1
Join discussion

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