Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way in an automation to copy a user field from Assignee?

Phil Bustin
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.
June 2, 2023

I have an automation that clones an issue in Jira software from a JSM issue.

Perhaps in a second automation triggered by the creation of the new issue (or even the original clone automation), I'd like to be able to copy Assignee to a custom field.

It doesn't appear to me that this is possible in a field copy edit component in an automation. 

 

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
June 2, 2023

Hi @Phil Bustin 

Are you trying to copy the assignee to a custom, user field, such as with {{issue.assignee.accountId}} ?  What is not working as you expect?

Kind regards,
Bill

Phil Bustin
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.
June 2, 2023

I see!  I was trying to use the Copy function instead of the Set function.  Question: Why use .accountId?  Would just {{issue.assignee}} work, or if not, then {{issue.assignee.name}}?

Bill Sheboy
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.
June 2, 2023

In general, user fields are set with accountId for the user, and then Jira automagically figures out the rest.  When using just {{issue.assignee}} I believe that will work in most cases because the default attribute is the accountId.

However...let's say you were doing an advanced branch on a set of users (like watchers).  The entire user object is provided, allowing you to later reference accountId, displayName, etc.

Phil Bustin
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.
June 2, 2023

Well, none of the above worked, but I figured out I can't have an assignee for the first status anyway--so for this particular effort, it doesn't matter.  Still I wonder why when I did provide an assignee, the other field wasn't copied from it.

Phil Bustin
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.
June 2, 2023

Actually, I could create an automation for when the user provides a value for Assignee.  So I'm interested again in making this work.

Like Bill Sheboy likes this
Bill Sheboy
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.
June 2, 2023

Phil, I am puzzled why the copy would not work.  Would you please post an image of your rule?

If your trigger is Issue Created, the cause could be that timing problem where the trigger fires faster than the data is available, leading to an empty field when the copy is attempted.  The work-around for that is to add the Re-fetch Issue action immediately after the trigger.

Phil Bustin
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.
June 2, 2023

Solved.  Thanks for your help.  What did work is a new rule triggered by adding a value to Assignee for all operations, and that is all I need for this function. 

When I looked at one of the other automations, I found that I had forgotten to click Enter after entering the smart value, so that explains why that automation didn't work.

I then removed the edits from both of the two automations in which the edit wasn't working, since I now do not want to set the field in those automations.  Since the new automation works, I'll just assume I needed a re-fetch in one, and that the other would have worked if I had actually placed smart values in its edit.

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events