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

This widget could not be displayed.

What version of jira is this?

This widget could not be displayed.

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 Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 25, 2018 in Marketplace Apps

Jira Cloud and Bitbucket Cloud Integration with Microsoft Teams

One of the newest products in the Microsoft family - Microsoft Teams,  is a chat-based hub for teamwork that integrates all the people, content, and tools your team needs to be more engaged and ...

733 views 0 3
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