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

0 vote

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 10, 2018 in Marketplace Apps

Learn about how Stefan K. built one of the *first ever* Marketplace apps

In this post you will discover more about the evolution of K15t software, some big topics they're currently focusing on in the app space, and a rare (not not funny!) photo of founders Mike Cannon-Bro...

12,640 views 11 24
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