Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Populating an issue field with a specific Asset attribute

Robert Hook
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 13, 2024

I have been trying to figure out a way to get an issue reporter's phone number into a custom field within the issue. I realize Atlassian doesn't store phone number in its User data, so that takes out the simple smart value route like you are able to do with {{reporter.emailAddress}}. I added users as an asset object and imported everyone from our organization into it along with their phone numbers as an object attribute. I realize this requires me to manually add/import any new hires into the Users objects, but I don't mind that piece since we are a relatively small organization.

I cannot seem to get that specific attribute to display in an issue field though. The Users asset object is set up as shown below:
Jira1.jpg

Jira2.jpg

I can point a query to the user to match the issue reporter by using
objectType = "Users" AND "Jira User Name" = currentReporter()

I don't know where to go from there to get to the phone number (or whether I am totally barking up the wrong tree). I tried various attempts with automation to pull in the phone number, namely by using an AQL query and then trying to reference its value with the {{lookupObjects}} smart value, but I seem to be failing at directing it to that specific attribute. Clearly I am a novice with queries and have no SQL or similar background to reference. There also may be a much easier way to accomplish what I am after, but I am the only person in our organization who has been willing to explore Jira's functionality.

1 answer

0 votes
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 13, 2024

@Robert Hook , Welcome to the Atlassian Community!

If you are using any Jira fields associated with Assets, you can iterate over the project using the following value:

{{issue.customfield_XXX.Attribute}}. In your case, {{issue.customfield_XXX.Office Phone}}

XXX it is related to field id created.

But if you want to do it without using an Assets field, you can get this.

In your automation that search for AQL objects, select this: ObjectType = Users AND Name IN ("{{issue.reporter.displayName}}")

This will get the object in your AQL that corresponds to the name of the user who created the issue in Jira

Then you can use the same logical object indentation feature using the following:

{{lookupObjects.Office Phone}}

It is expected that your AQL search will only bring up one object associated with the user, so the Office Phone will be from the same user retrieved in Assets. This AQL automation depends on your users' names in Jira matching the Names you assigned in Assets

 

Let us know if you have any questions

Kind Regards,

Fernando

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events