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

Copy Assets object attribute to issue custom field via automation

Carlos Chang
Contributor
January 16, 2023

Hi guys,

 

I'm trying to fetch object attribute and copy to custom field in the same issue, I'd like to use automation, is it possible?

There's a post-function that could perfectly get it done, unfortunately, this method only exist in Server/DC.

I know it's probably easier with groovy scripts, but it will not fulfill customer's expectations for now.

 

Kind regards,

Carlos

3 answers

1 accepted

4 votes
Answer accepted
Gideon Nolte _Eficode_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2023

Hi @Carlos Chang

this can be done with Automation for Jira with the "Edit Issue" action and SmartValues

If the Object is present in a customfield of the issue, you can use the SmartValue {{issue.customfield_XXXXX.objectAttribute}} (e.g. {{issue.customfield_10500.Name}}). If the object is not present on the issue, you can use the "Lookup Object" action to get all objects specified by AQL. To access these objects' attributes, you can than use {{lookupIssues.objectAttribute}}.

Hope this helps. Feel free to let me know if you have any more questions

Greetings
Gideon

Carlos Chang
Contributor
January 17, 2023

Hi @Gideon Nolte _Eficode_ 

SmartValue works! Genius.

 

Kind regards,

Carlos

Like Gideon Nolte _Eficode_ likes this
jun lee
Contributor
March 22, 2023

Hi @Carlos Chang 

I am trying to copy object's attribute (manager) to a custom field (User Picker (multiple users)). Manager attributes have plural individual account. 

supportgroup.jpg

 

I added an automation rule, but it doesn't work. Can you help me?

2023-03-22 16 22 41.jpg

Gideon Nolte _Eficode_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2023

Hi @jun lee ,

two things you would need to fix here: 

1. Use the "normal" way (not the Additional fields option) to set the field value. It's the field which with the placeholder "Type to find matching users". In there you should be able to set the value via a Smart Value.

2. Given that customfield_13809 holds an object of type "supportgroup", you will have to provide the "ENM_USER_MULTI" field with a list of account IDs rather than objects. What I mean by this is, that the current Smart Value `{{issue.customfield_13809.manager}}` will evaluate to the manager object(s) rather than the mangers' accounts which will most likely be stored in an attribute of type "User" on the "Manager" objects. Let's assume that the attribute which holds the manager's user  is called "Account". Then the correct Smart Value would be `{{issue.customfield_13809.manager.Account}}`.

Hope this helps. Let me know if you have any more problems with that.

Greetings
Gideon

Like jun lee likes this
jun lee
Contributor
April 3, 2023

Hi @Gideon Nolte _Eficode_ 

I tried second method like 

{{issue.customfield_13809.manager.Account}}

{{issue.customfield_13809.manager.Name}}

{{issue.customfield_13809.manager.email}}

However, Audit log is success althought it doesn't work

 

2023-04-04 15 13 29.jpg

 

2023-04-04 15 19 04.jpg

 

 

2023-04-04 15 18 37.jpg

Gideon Nolte _Eficode_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2023

Hi @jun lee ,

could you provide me a screenshot of the attributes for the manager object type. Is the "email" attribute of type User? Is there an attribute on the Manger Object Type that is of type User? If yes, try using that.

Greetings
Gideon

jun lee
Contributor
April 12, 2023

Hi @Gideon Nolte _Eficode_ 

Yes, email is the attribute of the Manager object. 

2023-04-13 15 43 12.jpg

I am trying with different field.  I added "department" attribute to the "manager" object, made a custom filed 13901 (object type), and I added automation rule as {{issue.customfield_13901.department}}

2023-04-13 15 45 12.jpg2023-04-13 15 44 24.jpg

 

However audit log of the automation rule was failed.

2023-04-13 15 51 18.jpg

 

ENMCOMM-379 issue has custom field 13901 ("ENM_manager") and custom field "ENM_Department"

2023-04-13 15 50 13.jpg

 

0 votes
Clyde W_ Moseley
Contributor
October 17, 2024

Doesn't the DC version actually have the ability to create an asset attribute field that would automatically update when the attribute of a related object on a ticket changes?

0 votes
谢 志锋
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!
June 24, 2024

If you are DC version , this is not possible, the solution is only for cloud. dc is very limited. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events