Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner Cloud Listener: Getting 404 when trying to use GET method on updated issue

Jake Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2019

Hey guys, right now I'm trying to update the status of issue 'A' as the listener catches issue 'B' transitioning into 'In Progress'. Apparently the get method wasn't as simple as I thought, this is what I have so far: 

 

//Getting issue 'B' 
def updatedIssue = get("/rest/api/2/issue/" + issue.key)
.asObject(Map)
.body

//Isolating the status name, then linked parent maps
def issueStatus = updatedIssue.fields.status.statusCategory.name
def issueParents = updatedIssue.fields.issuelinks.inwardIssue

 

After getting NullPointerException errors, I printed out the status of the request and found that I was getting 404.

Not sure what to do here, I assume the listener script is being ran before issue 'B' is done updating.

Any further explanation on this matter and/or solutions would be greatly appreciated!

 

 

1 answer

1 accepted

0 votes
Answer accepted
Jake Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2019

Update: Trying to perform a GET request was completely the wrong route. I was able to get the new status using the changelog variable, and the parents using the issue variable

def newIssueStatus = changelog.items.toString 

and

def issueParents = issue.fields.issuelinks.inwardIssue 

Suggest an answer

Log in or Sign up to answer