Skip to content

Jira

Jira query summary exact match

issueFunction in issueFieldExactMatch("Project = PROJECTNAME", "summary", "lookuptext")

Requires scriptrunner.

Jira Mail Queue Status

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
import groovy.transform.BaseScript
import groovyx.net.http.ContentType
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method

import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

import com.atlassian.jira.component.ComponentAccessor

@BaseScript CustomEndpointDelegate delegate

// Return statistics of outgoing mail
// TODO ought to require authentication but it doesn't

getMailQueueSize(httpMethod: "GET") { MultivaluedMap queryParams ->
    def mailQueueSize = ComponentAccessor.getMailQueue().size()
    result = ["mail_queue": mailQueueSize]

    return Response.ok(new JsonBuilder(result).toString()).build()
}

then call REST API of /rest/scriptrunner/latest/custom/getMailQueueSize.json.

REquires scriptrunner.