Forums

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

Any Script to Copy the users in Watchers field and add it to custom user picker field?

Jeremy Price March 31, 2022

 

I'm seeing if there is any scriptrunner script I can use

or automation for jira function that will take the users being added to the System Watchers field into a Custom User Picker (multi-select) field that I have created?

I can use my Automation for Jira to go the other way. Anytime a value is added to my custom "Add Watchers" field it will automatically add those values to the System Watchers field. However, I haven't figured out a way to do the other way around. 

When a user is added to the System Watchers field they will automatically get added to my custom field of Add Watchers.

I have Scriptrunner and Automation for Jira.

I tried using the Edit Issue option with  the Smart Value of {{issue.Watchers}} below but it doesn't return the email address in that Watchers field just their ID which doesn't work as expected. 

 

Project-automation-(1).pngProject-automation-.png

1 answer

0 votes
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.
April 15, 2022

Hi @Jeremy Price 

I would have expected that to work as setting the id is what is needed for user fields.  The only thing that stands out is smart values are case-sensitive so perhaps try {{issue.watchers}}

If that does not help, you could instead use advanced edit with JSON (under More options) to parse/add the id values, as shown here:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer