Can someone help me ? I have set up the configuration but when I create issues nothing happens ? What I need is when monitoring tool = Not Applicable or monitoring tool = None in the MOC Turnover I need a ticket cloned in our monitoring project
It wouldn't let me attach a screen shot but below is the details of what is currently set up
condition = issue.projectObject.key != 'NET' & issue.issueType.name != 'Incident 2' & cfValues['Monitoring Tool'] in ['None', 'N/A (Not Applicable)']
Target project = Monitoring
Target Issue Type = Incident
Additional Issues and Actions = def cf = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Incident Type'}
issue.setCustomFieldValue(cf, sourceIssue.getCustomFieldValue(cf))
Issue Link Type Direction = relates to
Any help would be greatly appreciated !!!
This was answered via a support ticket with the following:
As the "Monitoring Tool" field is a Multi-Select list, one way to check if it contains specified values in a Post Function or Listener condition would be like this:
import org.apache.log4j.Logger import org.apache.log4j.Level def log = Logger.getLogger(getClass()) log.setLevel(Level.DEBUG) List<String> myList = ['None-No alert triggered', 'N/A (Not Applicable)-Not Monitored by GTS'] def chosenList = cfValues['Monitoring Tool']*.value log.debug("mylist = " + myList) log.debug("chosenList = " + chosenList) Boolean selectionIsInList = chosenList.any{ item -> myList.contains(item) } log.debug("selectionIsInList = " + selectionIsInList) Boolean result = issue.projectObject.key == 'NET' && issue.issueType.name == 'Incident 2' && selectionIsInList log.debug("result = " + result) return result
The debug logging can be removed after you have checked it works as expected.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.