def formFieldA = getFieldByName('fieldA')
def formFieldB = getFieldByName('fieldB')
def map = [
'A':['Monday', 'Wednesday'],
'AB':['Monday', 'Tuesday']
]
def cfFieldB = customFieldManager.getCustomFieldObject(formFieldB.fieldId)
def config = cfFieldB.getRelevantConfig(issueContext)
def allOptions = optionsManager.getOptions(config)
def optionsToAllow = allOptions.findAll{ option->
map[formFieldA.value].contains(option.value)
}
formFieldB.setFieldOptions(optionsToAllow)I have this script which is working fine.. select list changing multi slect.
What i should change here to have multiselect change multi slect?
Please let me know
You can use the "fast track transition" script postfunction of script runner in the create tansition of the workflow B ...
I think you should add a customfield which will let you distinguish if the issue was created from workflow A or independently. Then you could use this custom field in your condition. For example, let 's say you create a field called "createStatus". And you fill it with value 1 if it is created from the workfow A and with value 2 if it is created independently. Then your condition would look like this:
def createStatus = ComponentAccessor.getCustomFieldManager().getCusomFieldObjectByName("createStatus")
issue.getCustomFieldValue(createStatus) == 1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the approach @Alexey Matveev , this i the one I would like to pursue. However, I am trying to setup the custom field here but again am stuck with the scripting part, I looked up the Scriptrunner documentation but could not find how to identify an issue if it is generated by another workflow or initiated by the current version.
Could you possibly point me in right direction if this data exists somewhere please?
Thanks
Ankit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should create a usual custom field, not a scripted field. And then fill it in the post function which you use for creating issues from your workflow. How do you create issues from the workflow? What plugin do you use?
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.