scriptrunner post function to add watchers based on component

I am trying to write a post function using script runner to add watchers to the issue when created depending on components. 

I was able to get the watchers to be added but i am not able to get a condition check with component working. How do i get a list of components for the issue and then define a user list to be added as watchers.

5 answers

This widget could not be displayed.

For example the following would be true if there is a component call Foo selected:

"Foo" in issue.getComponents()*.name
This widget could not be displayed.

Hi Hermant, I'm trying to do the same thing- can you share the script you used to add watchers upon create issue?

 

This widget could not be displayed.

@Jamie Echlin [Adaptavist], can you help with this? I'm just trying to get the script to run for adding watchers upon issue create. 

This widget could not be displayed.

Apologies, my scripting capabilities are somewhat limited.  I took a look at the link but I'm not sure it suits the use case.  Upon issue creation (post function) I need a watcher to be automatically added based on a component selected.  I couldn't find that information in the link.  sad

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

109 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you