Automation for JIRA: Set Custom User Picker Field by user who triggered the event.

Jeffrey Bistrong
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.
December 30, 2019

Here is the full details of my issue.

 

I have a custom field, that is a user picker field. The name of my custom field is "UX2_Reviewed_by" .

 

I have one other field in my ticket that is a set of check boxes. I cannot get the below proposed automation to work. Any ideas?

 

Proposed automation

When a user updates the value on the checkbox field, I want the user to automatically be populated in my custom user picker field. I am trying to accomplish this using the action: "set entity property", however, i keep receiving the following error "Error setting entity property for issue:"

I have tried variations of the following property keys/property value.

 

accountID

DisplayName

 

set_ent_property.png

2 answers

1 accepted

2 votes
Answer accepted
michael.mandel December 30, 2019

Hey Jeffrey,

 

Since you're trying to update a custom field, you should use the "Edit Issue" component to update the UX2_Reviewed_by custom field.

Jeffrey Bistrong
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.
December 30, 2019

Thanks, but when I do edit issue, there is no option to set this as "user who triggered the event"...... am I missing something

 

Automation rules - JIRA 2019-12-30 18-37-35.png

michael.mandel December 30, 2019

Hey Jeffrey,

From there you can use the "Additional Fields" section. Set it up as the screenshot below and it should work for you. Also you can refer to the documentation here for advanced field editing: https://docs.automationforjira.com/issues/edit-additional-fields.html#format-of-the-json

Screen Shot 2019-12-30 at 8.50.04 AM.png

Like Marco Villalobos likes this
Jeffrey Bistrong
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.
December 30, 2019

Amazing! Thanks so much for the help. 

 

I had to make a few adjustments, so for anyone else who wants to do this here is the proper code. 

 

 "UX2_Reviewed_by": {"id": "{{initiator.accountID}}" }



Like # people like this
Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2020

@michael.mandel @Jeffrey Bistrong Hi both, I know this is a slightly old post but I could really do with some help with something very similar!

I'm looking to set a user picker custom field (called "Task owner") to the same value as the assignee (or initiator, if assignee isn't possible...) when the issue is transitioned from A -> B. I've tried a few combinations, but I'm getting an audit log error of Error while parsing additional fields. Not valid JSON. Any suggestionscode.PNG

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2020

No worries, fixed it! I had the wrong format with my brackets :)

Brock Jolet August 14, 2020

I wonder if anyone can help me sort this out. I'm doing basically exactly what you guys have typed above. I have a custom field user picker that I want to update. I used the same code I see above and I get a success when it runs. However, the custom field doesn't update. It clears the current value then doesn't update to the new value.

2020-08-14_16-28-51.png2020-08-14_16-29-30.png

Jeffrey Bistrong
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.
August 18, 2020

I would suggest using the log action to verify it is logging the proper output

This will help you determine what layer the problem is a and whether the proper value is being set.

Automation rules - JIRA 2020-08-18 09-50-10.png

Like Brock Jolet likes this
Brock Jolet August 19, 2020

I never did get this solution to work as typed. However, after a re-index my custom field appeared as an option in the drop-down to simply automate it through the UI.

Samuel Rodriguez January 19, 2022

When I take the ", I get a JSON parsing error.

Error while parsing additional fields. Not valid JSON.

{
    "fields": {
        "Story point estimate": {{triggerissue.Story point estimate}}
    }
}

4 votes
Fahdil Ahady Hazain December 13, 2020

works for me too yeay... for multi user picker i used this

{
"fields": {
"Approved By": [{
"id": "{{initiator.accountID}}"
}]
}
}

 

Mathew Levell July 21, 2022

So I'm trying I'm using the status transition to populate the user picker field but for some reason its just showing unassigned. Any suggestions


{
"fields": {
"Triage Engineer": {
"id": "{{initiator.accountID}}"
}
}
}

Screenshot 2022-07-21 112340.png
Jeffrey Bistrong
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 21, 2022

Hey Matthew, 

 

could you use the log action to confirm your output is correct?

 

Are there any errors in audit log?

 

Could you show a screen shot of the automation?

Like Dave Liao likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events