Hi,
I'm trying to get git tag information for a ticket and surface that information for JQL queries using scriptrunner scripted fields. My JIRA instance has the add-on "git integration for JIRA" which provides an api to query the tags:
/rest/gitplugin/1.0/issuegitdetails/issue/{issueKey}/tagI would like to be able to call this as a specific user on the system, but am not sure if this can be done within a scripted field.
What I have so far:
import org.apache.http.HttpResponse
import groovyx.net.http.ContentType
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
def http = new HTTPBuilder("https://my-jira-test-system.com")
try {
http.get( path : "/rest/gitplugin/1.0/issuegitdetails/issue/${issue.key}/tag" ) { response, reader ->
assert response instanceof HttpResponse
log.warn "response status: ${response.statusLine}"
log.warn "body: ${reader}"
}
}
catch (e) {
log.warn e
}
return "git tags here"
How can I update the code above to call the api as a specific user?
Can I cache the result until an event is fired (a specific workflow transition)?
Thanks,
Matt