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?
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
I am facing a problem where I want to check the value of entity property in an automation rule like such:
"{{issue.reporter.properties.JobRole}}"="{name=QE}"
but I always get the error of:
("{name=QE}"="{name=QE}")" - Field '{name=QE}' does not exist or you do not have permission to view it.
It always evaluates the property. I am setting the property via the rest api.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vaishali Patil So your entity property is JobRole? It would be helpful if you could show the JSON of the property. This tool would allow you to display it:
https://marketplace.atlassian.com/apps/1214509/entity-property-tool-for-jira
(Caveat: You don't want to leave it enabled - it shows the entity properties to all users, which can be confusing.)
Without being able to see the property, I'm going to guess that maybe what might work is:
{{issue.reporter.properties.JobRole.name}} = "QE"
Or this should also work:
{{reporter.properties.JobRole.name}} = "QE"
References:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-users/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee I figured out what I was doing wrong. I was using jql instead of 'advanced compare condition. It started working when I switched it.
I tried the entity-property tool but it wouldnt work for user. It worked only for issue. Btw, we can see the properties by browsing to
https://your-domain.atlassian.com/rest/api/3/user/properties/{propertyKey}?accountId={accountId}
The value is stored as json so the value for me was {name=QE}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has anyone gotten a solution for this?
I'm trying to access a property value within Automation however no value is retrieved using any of the formats suggested above.
Is there any other way in a automation action or condition i can utilize user property values?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @krnaicker -- Welcome to the Atlassian Community!
After a bunch of tinkering, I finally got this to work in an automation rule:
{{issue.properties."myNameSpaceExample.myKey"}}
The values I used when I Set Entity Property were:
This didn't match any of the documented examples I found thus far; they either had no quotation marks or had them in different locations.. I still cannot get access to the property via JQL. I am starting to wonder if this feature is still experimental. :^)
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Bill, there's a bit in the docs for Entity properties here that says:
Jira Server plugins can provide a module descriptor that will make the issue properties searchable using JQL.
https://developer.atlassian.com/server/jira/platform/entity-properties/
So... I guess it works if you're creating a plugin.
Here's details on that module for cloud:
https://developer.atlassian.com/cloud/jira/platform/modules/entity-property/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, and I completely neglected to thank you for the tip on putting the key in quotes.
By the way, it turns out you can ALSO load a whole JSON object into an entity, like so:
{ "App1" : "assigneeid1",
"App2" : "assigneeid2",
"Some App" : "assigneeid3"}
I set the above as the value for a Project Entity Property key subtaskAssignees using an Automation rule.
And then I was able to reference individual keys thusly:
{{project.properties.subtaskAssignees."App1"}}
Now... if I could just figure out how to iterate through a list of Checkbox values and create Subtasks that are assigned according to that mapping, with Summaries based on the Checkbox values, then we'd be in business. :-}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.