Hello,
I have an Insight object type (Support Responsibility) with a Role attribute that is of the type User (multiple selection is possible).
How do I get the value of the Role attribute (the users) in a custom field of the type Multi User Picker? We plan to use the users in this custom field to manage notifications.
So far I've tried using Process Automation and Smart Values, but they only gave me access to the Key and Name attributes, and not custom attributes (such as Role).
How would you solve the problem (preferably without scripting).
Using Jira 9.1.0, on-prem.
Thanks in advance.
Hi @Kölker, Finn ,
Indeed you can not retrieve the EmailAddress from an insight User attribute from a smart value, this is weird as this works for every other User custom field :)
The workaround you could use is the following : you can populate a multi-user custom field based on the users in the attribute "Role" of your Insight object "Support Responsibility".
To do this, build an automation rule which edits your multi-user custom field. To edit the custom field, select the "Advanced" option and enter the following JSON :
{
"fields": {
"NameOfYourCustomField": {{issue.customfield_XXXXX.Role.flatten.asJsonObjectArray("id")}}
}
}
Let me know if it works,
Guilhem
Hello,
Thanks for your answer!
Getting the users in Role 1 via the custom field does not work. But what we have done now is to send a web request via Project Automation that provides us with the data we need. Your suggested JSON formatting helped a lot.
The selector currently looks like this:
{{webhookResponse.body.get(6).objectAttributeValues.asJsonObjectArray("user.name")}}
And returns us this:
[
{
"user.name": "fkoelker"
},
{
"user.name": "jdoe"
}
]
What I am currently failing at is making a list of user names from this array of JSON objects. So what I need would be at best:
["fkoelker", "jdoe"]
Do you have an idea on how to achieve that?
~Finn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately I'm no JSON expert,
Are you sure getting the users in role 1 doesn't work ? I tried it on a test instance and it worked.
Can you please try to add a comment in an issue with the following smart value and tell me what you ou get ?
{{issue.customfield_XXXXX.NameOfYourInsightAttribute.flatten.asJsonObjectArray("id")}}
And with your API call you could try removing the "asJsonObject" part and see if it's better ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for your fast answer.
Using
{{issue.customfield_16102.Role 1.flatten.asJsonObjectArray("id")}}
the added comment's content is just "[]".
Or could it be that the key is wrong? Do you know if I can somehow display the Insight object in JSON format?
---
If I remove the "asJsonObjectArray" of my API call, the response gives me more information, that I do not need.
Using the API call I mentioned in my previous comment, I've narrowed down the content of the response as much as possible, which is what I was getting at.
~Finn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It seems like I was just overthinking it. It was enough to enter the smart value
{{webhookResponse.body.get(6).objectAttributeValues.user.name}}
in the custom field.
Anyway, I really appreciate your help.
~Finn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, good to know it ended up working for you !
Best of luck,
Guilhem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.