Accessing JIRA issue object in REST endpoint

I have the following code for a REST Endpoint

import groovy.json.JsonBuilder
import groovy.transform.BaseScript

import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField

@BaseScript CustomEndpointDelegate delegate

tempoWorkType(httpMethod: "GET") { MultivaluedMap queryParams, String body ->

    def callbackFn = queryParams.getFirst("callback")
    def issuekey = queryParams.getFirst("issueKey")
    ComponentManager componentManager = ComponentManager.instance
    IssueManager issueManager = componentManager.getIssueManager()
    MutableIssue issue = issueManager.getIssueByCurrentKey(issuekey.toString())
   CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()

I get an error 'Cannot find matching method' for the lines in bold above. Can someone let me know what I am doing wrong?



2 answers

What version of jira is this?

Hi Vidula,

Have you tried adding in the two following import statements in order to import the Issue Manager and CustomFieldManager.

  1. import com.atlassian.jira.issue.IssueManager;
  2. import com.atlassian.jira.issue.CustomFieldManager;



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,686 views 3 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you