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?
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()])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.