My apologies if I'm not posting in the correct place.
I have an inline Script Runner post function that works perfectly on a subsequent transition, but does not work on the create transition.
It takes the value from a custom field (Support Queue) and uses that to generate the user group to select from a single select list.
import com.atlassian.jira.component.ComponentAccessor
def projectComponentManager = ComponentAccessor.getProjectComponentManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def groupManager = ComponentAccessor.getGroupManager()
def queueCf = customFieldManager.getCustomFieldObjectByName("Support Queue")
String qname = issue.getCustomFieldValue(queueCf)
def singleGroupCf = customFieldManager.getCustomFieldObjectByName("Notify Group")
def group = groupManager.getGroup("Notify " + qname)
issue.setCustomFieldValue(singleGroupCf, [group])It is working correctly on my "Escalate" transition, but not working on the create transition. On Create, nothing is populated in the "Notify Group" field.
I am thinking maybe something is not available on create that is available in later transitions?
On create, I actually copy the issue type name into the "Support Queue" field, This is done in a post function prior to the script post function.
If need to use "Issue Type" instead of the custom field to find the name, that would be good too.
I tried
String qname = issue.issueType.name
But that didn't work either.
Any help would be greatly apprciated!
Make sure you add your behaviour to the Priority field - and you have the right field ID's
It should look like this
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.