Copy value from Security Level to Component

We have a couple of queues where the Security Level and Component are identical and we when at ticket is transferred to those queues both need to be set. Short story is people aren't doing that properly, so I want to be able to have the Security Level value set the Component (having only one component selected) and have not gotten it to successfully replace the value that it was. I was trying to figure out some groovy script to do it, but am so far unable to get anything working.

Does anyone have any pointers on how I could accomplish this?

1 answer

0 vote

Your groovy will need to convert from a security level to a component (obviously, using the name).  What have you got so far?


Sorry, it looks as if I wasn't clear enough. I don't have any background in scripting groovy before, and haven't found any information on how to script for this, but here is what I have: ComponentManager componentManager = ComponentManager.getInstance() componentManager.getProjectComponentManager().findByComponentName(project.getId(), issue.get("security")) issue.setComponents([component.getGenericValue()])

Ok, that's a start. What you need to do is work out a match on the name of the security level on to the component. Both security level and component are distinct object types, so you need to get the names out and do a lookup, so something like: def securitylevel = componentManager.getProjectComponentManager().findByComponentName(project.getId(), issue.get("security").getName() ) def component = componentManager.getProjectComponentManager().findByComponentName(project.getId(),securitylevel) issue.setComponentObjects([component])

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,254 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot