Hi community;
My enterprise has changed to be working in cloud until February to now work in server, and for me is very different but I know how works the scripts in cloud by the rest api, and to do the cahange ... wow!!!
I put here a simple code in cloud and I need to understand how I can transform in server
Thanks
I put here the code to copy and paste if you need
def projectKey = 'XXXX'
/*
{ "startAt": 0,
"maxResults": 50, no poner más de 100 porque peta por todos lados
"total": 250,
"issues": [] }
*/
def resultx = get('/rest/api/2/search?jql=project='+projectKey+'&maxResults=100&startAt=0')
.header('Content-Type', 'application/json')
.asObject(Map)
if (result.status == 200){
log.warn('Total Issues = ' + result.body.total)
} else {
return "Failed to find issue: Status:"+result.status
}
def links = result.body.issues.fields.issuelinks
def tipo = result.body.issues.fields.issuelinks.outwardIssue.fields.issuetype
return tipo
It's not entirely clear what you mean. Are you saying that a particular REST API call that works with Jira Cloud doesn't work with Jira Server?
The REST API call:
/rest/api/2/search?jql=project=<key>&maxResults=100&startAt=0
inside your script is completely valid for Jira Server, as per this section of the Jira Server REST API documentation.
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.