I want to check that a particular field is available for a given Issue Type (called Task), however this is proving tricky.
I am using the api /rest/api/2/issue/createmeta which should return a list of fields and their meta data.
For simplicity, I've written a script that checks that the field 'summary' is available (since I know it always will be, and is in fact the first field returned). My script is:
def issueMeta = get('/rest/api/2/issue/createmeta?projectKeys=XXX&issuetypeNames=Task&expand=projects.issuetypes.fields')
.asObject(Map)
assert issueMeta.status == 200
def versionField = issueMeta.body.projects.issuetypes.fields.find { it.key == "summary"}
logger.info("version is ${versionField}")The logger is returning "version is null".
Any help to work out what I'm doing wrong would be very much appreciated.