I'm trying to get the data out of a cascading select custom field, but I'm not having much luck. This code seems to work for getting the value of the second selection, but I can't get at the first:
from com.atlassian.jira import ComponentManager
import urllib
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
customFieldManager = ComponentManager.getInstance().getCustomFieldManager()
# Get the issue number
key = issue.getKey()
# Get value of the 'Revision' field
revisionField = customFieldManager.getCustomFieldObjectByName("Revision")
revision = issue.getCustomFieldValue(revisionField)
# Get value of the 'Domain and Application' field
serviceField = customFieldManager.getCustomFieldObjectByName("Domain and Application")
service = issue.getCustomFieldValue(serviceField)
domain=service['']
application=service['1']
# Kick off the job in Jenkins
params = urllib.urlencode({'SVN_REVISION': revision, 'ISSUE_NUMBER': key, 'DOMAIN': domain, 'APPLICATION': application})
f = urllib.urlopen("http://jenkins/job/flexB-ApplicationService-trunk-jira-test/buildWithParameters?token=flexB-ApplicationService-trunk", params)
print f.read()
This works for getting to the second value (service, or position '1'), but I can't seem to get the first value (domain, or position 'null'). What amm I missing here?
This is a post function in our workflow, and we're running Jira 5.1.4 with Jira Scripting Suite.
Thanks!
Bill