Setting a custom single user select in automation

Patty Banks July 12, 2021

I am trying to create my first automation.  I want the automation to automatically set a custom field called Developer to the name of the user who the ticket is assigned to when it transitions.    I've tried many different settings and can't seem to get this to work.   Here's the last attempt:

 

{
"fields": {
"customfield_13536" : { "value" : "{(Assignee.displayName}}" }
}
}

2 answers

1 vote
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.
July 12, 2021

Hi @Patty Banks 

What type of field is customfield_13536: is it a user field or just a plain text field?

If it is a user field, please try something like shown on this documentation page:

{
    "fields": {
        "customfield_13536": { "id": "{{issue.assignee.accountId}}" }
    }
}

Best regards,
Bill

Patty Banks July 13, 2021

It's a user field.  In the UI, I type in the name of a user and finds the matching user in the dropdown.  I didn't try it with the "issue" prefix.  I will try that now and let you know.

Patty Banks July 13, 2021

Hi Bill,

Thanks for the info.  It was still not succesful.  In fact, if I try to set it to anything other than "value", I get this error message.  If I set it to value and specify issue.assignee.accountId or issue.assignee.displayName, I get a success status but nothing changes.    I am using the cloud version of Jira.

 

Picture1.png

 

The meta data associated with my field is:

"customfield_13536":{"required":false,"schema":{"type":"user","custom":"com.atlassian.jira.plugin.system.customfieldtypes:userpicker","customId":13536},"name":"Developer","key":"customfield_13536","autoCompleteUrl":"https://redi2tech.atlassian.net/rest/api/1.0/users/picker?fieldName=customfield_13536&fieldConfigId=14587&projectId=11100&showAvatar=true&query=","operations":["set"]}

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.
July 19, 2021

Okay, that is odd.  For a user field the ID attribute should be present for setting.

Have you tried to just use the field name "Developer" from the drop-down list?  The custom fields I am using are listed as available fields for the edit issue action.

0 votes
Daniel Ebers
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.
July 17, 2021

Hi @Patty Banks

I do not show up with a solution for fixing the rule - however I would be interested in if there is a specific reason for creating the rule like this?
In a test it was possible to copy over the value from assignee - am I missing a point?

grafik.png

Please accept my apologies if this should not be the route you want to choose. If you want to do it the way you showed it is okay - but I cannot provide a solution.

Is it a company-managed or a team-managed project?

The test above was in a company-managed project and worked out fine so I would be too curious what is differing from your setup.

Regards,
Daniel

Suggest an answer

Log in or Sign up to answer