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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,397
Community Members
 
Community Events
176
Community Groups

Is there anyone who can give me a script behavior or listener runner which can set auto-watchers?

Hi, I want to have a runner which can set auto-watchers. In one project, several users could be automatically added as watchers to certain kind of issue type, such as "Bug". Could anyone help? Thank you in advance.

1 answer

1 accepted

0 votes
Answer accepted

Hi @Jason Liu ,

A firtst option is to use https://marketplace.atlassian.com/apps/1215460/automation-for-jira-data-center-and-server?tab=overview&hosting=server free app provided by Atlassian. Based on issue event and issue type you can add watchers as single users or as a group.

Another option is to use JSU app (https://marketplace.atlassian.com/apps/5048/jsu-automation-suite-for-jira-workflows?hosting=server&tab=overview) and, in particular, Update Any issue field post function.

Add that post function on creation related Bug workflow and select Watchers field.

This should fix your issue. 

Hope this helps,

Fabio

Hi Fabio, I tried JSU update any issue field or copy value from other field, and it showed error when I tried to create an issue. It's "We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file."

Hi @Jason Liu ,

error probably is related to uncorrect value set in JSU post function. Please share your current setup.

BTW, my suggestion is to setup an automation.

I configured a field "designer" and used Copy Value From Other Field (JSU) to copy designer to watchers. Precondition must be: Ignore precondition. Issue Relation:
Within same Issue. and append. 

Please Designer is a custom field so we need to know the custom field type.

Hi Fabio, I was reminded by you about the custom field type and checked that designer was user picker (single user). But I tried to change it to another custom field owner which is user picker (multiple users) and it also showed that error code.

Hi @Jason Liu ,

it is strange because it should work. Did u setup overwrite,append or prepend?

I used append.

Hi @Jason Liu ,

I just tested it in a my local environment and it worked like a charm.

jsu.png

Please could you share a screenshot of your post functions like the the above one?

Hi Fabio, Please see the screen shot.

微信截图_20220315165302.png

is this a create transition? Please could you provide all the other post function for the transition (2,3,4...)?

Please move your post function after "Creates the issue originally". It will fix your issue.

Ciao,

Fabio

Hi Fabio, It's grey and cannot be deleted.微信截图_20220315170939.png

You should move down the first one. Create the issue originally should not be deleted but moved in first position.

jsu.png

@Jason Liu , did u try?

Hi Fabio, I did and it worked. No error now and I could create the issue. Thank you so much.

you're welcome @Jason Liu 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events