Hi guys,
Can someone help understand why the query provides null results?
def response = get('rest/api/3/issue/picker?query=project=myproject')
.header("Content-Type", "application/jason")
.asObject(Map)
response.body.issues.each { it ->
logger.info(it.key)
}
return response.body
def getIssueDetails(issue){
DeleteIssue.issue(issue.key)
}
def DeleteIssue(issueKey) {
logger.info("issues to be deleted: " + issueKey)
def resultDelete = delete('/rest/api/2/issue/'+issueKey)
.header("Content-Type", "application/jason")
.asObject(Map)
logger.info(response.body)
}
Hi @Hadas Hamerovv ,
I can see some problems like "getIssueDetails" is not called at all and "DeleteIssue" is called incorrectly.
Please try the code below:
String jqlSearch = "project = \"myproject\""
post('/rest/api/2/search')
.header('Content-Type', 'application/json')
.body([
jql: jqlSearch,
])
.asObject(Map).body.issues.each { Map issue ->
String issueKey = issue.key
logger.warn "Issue key: ${issueKey}"
delete('/rest/api/2/issue/' + issueKey)
.header("Content-Type", "application/json")
.asObject(Map)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.