Dear all,
I am using Script runner under Jira Cloud on which I need to convert Script Runner Script from our server side .
From our initial script we are checking different field like:
Actually I am retrieving for instance the information as below :
// Fetch the issue object from the key
def issue = get("/rest/api/2/issue/${issueKey}")
.header('Content-Type', 'application/json')
.asObject(Map)
.body
// Get all the fields from the issue as a Map
def fields = issue.fields as Map
def issueType=fields.issuetype as Map
def project= fields.project as Map
return project.key
Based on code snipet above, I am succesfully returning the project key
But I am not able to get the issueType name, any idea how to get it correcttly?
regards
serge
Hello @Hana Kučerová , I manage to get it the follwoing way only
def issue = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
def IssueType= issue.body.fields.issuetype.name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello @Hana Kučerová , I have tried and received the following exception
// Get all the fields from the issue as a Map
def fields = issue.fields as Map
return fields.issuetype.name
MissingPropertyException: No such property: fields for class: io.github.openunirest.http.HttpResponse
Any idea ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Hana Kučerová , I manage to get it the follwoing way only
def issue = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
def IssueType= issue.body.fields.issuetype.name
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.