You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.
Join groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.