Dear community,
Question: How do I get the data of the current issue, for with an event fired in a Scriptrunner listener?
Background: I am developing a little groovy script to send issue-data to a sharepoint list. I did the development in the "Groovy Console" of the "JIRA MISC WORKFLOW EXTENSIONS"-App. This console is very handy, as one can test the script against an existing issue.
My code is working perfectly fine in the JMWE-environment.
Unfortunately, I need to use a Scriptrunner listener, because I want to run my script on certain events. Scriptrunner handles things slightly different and I am struggling at the very beginning: how do I get the data of the current issue, for witch an event fired? What do I need to "import" to have access on the current issue?
My code:
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.RESTClient
import java.time.LocalDateTime
def issueKey = issue.getAsString("issuekey")
def issueStatus = issue.getAsString("status")
def issueTitle = issue.get("summary")
def issueDescription = issue.get('description')
def issueComment = issue.getAsString("comment")
def issueStartDate = issue.getAsString("customfield_10705")
def issueResolutionDate = issue.get("resolutiondate")
//log.info "${issueKey} --- ${issueStatus} --- ${issueTitle} --- ${issueDescription} --- ${issueStartDate} --- ${issueResolutionDate}"
//log.info "${issueComment}"
...
Any help or link to the documentation is very much appreciated.