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

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

534 views 23 15
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