I am using Jira cloud with script runner. I'm able to fetch a certain issue by hardcoding the issue key, however I want this to be dynamic by using the current issue that triggers my post-function:
def issueKey = 'WS-456'
def issue = get("/rest/api/2/issue/${issueKey}")
.header('Content-Type', 'application/json')
.asObject(Map)
.body
I want 'WS-456' to be dynamic please