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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

839 views 2 9
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