Automatically security level field update based on cascading custom field value in issue create and issue update .Thanks in advance
Hello Saroja,
You can use Automation for JIRA to achieve this kind of functionality:
Please, let me know if this option works for you.
Thanks petterson for your suggestions.
Is there any way to do with coding using script runner ?
Or through jira plugin development?
Thanks in advance
@Petter Gonçalves thanks for your suggestion.
Is there any way to do through code using scrip runner or through jira plugin ?
I'm not aware on how to build a Script using Script Runner to achieve this functionality, however, I think That the analysts from Adaptavist (maybe @Nic Brough -Adaptavist-) Could give you some insights about it.
Also, here's the ScriptRunner documentation:
- Adaptavist Script Runner
I can't say I'm an expert scripter!
But these two snippets could be bolted together:
This gets the current value from a cascading select and looks for "USA / California"
def values = [ "USA", "California" ]def customFieldManager = ComponentAccessor.getCustomFieldManager()def cascadingSelect = customFieldManager.getCustomFieldObjectsByName("My cascading field")[0]def cascadingOptions = issue.getCustomFieldValue(cascadingSelect) as Mapdef cascadingValues = [ cascadingOptions.get(null) as String, cascadingOptions.get("1") as String]if (cascadingValues == values) {(do something)}
And this sets a security level, assuming you know the id of the level you want to set is 10010 :
issue.setSecurityLevelId(10010)
It looks like you're new here. Sign in or register to get started.