Unable To Access Jira Issue From Within Plugin

richardwhittemoreomf June 12, 2019

Hi All,

We are developing a plugin for Jira 7.13.0. 

It will add a new web-panel to Jira Tasks and on this web panel there is a link that will display a pop-up form. 

dev-snapshot.PNG

We want to obtain the Jira Issue (ie. TI-192) so that we can auto-populate the 'Task Number' field on the pop-up form.

To do so, we were looking at the following Atlassian Tutorial: "tutorial-jira-scheduler" as a model for how we can do it. Link to this tutorial below:

https://bitbucket.org/atlassian_tutorial/tutorial-jira-scheduler/src/master/

 

In Particular, we were looking at the SchedulerWebworkModuleAction.java file in the tutorial. 

The doDefault() function in this class is calling the getIssueObject() function, and it is here that the global variable, id, is first being used. It isn't being set anywhere and yet when it runs, it has a value. Below are corresponding code snippets from the tutorial:

 

public String doDefault() throws Exception 
{

final Issue issue = getIssueObject();

...
}

 

public Issue getIssueObject() 
{

final IssueService.IssueResult issueResult = issueService.getIssue(authenticationContext.getLoggedInUser(), id);

if
(!issueResult.isValid())
{

this.addErrorCollection(issueResult.getErrorCollection());
return null;
}

return issueResult.getIssue();
}

 

Likewise, we tried to incorporate the same functionality in our plugin. The corresponding file in our plugin is CreateCCRAction.java. However, when we run our plugin, 'id' is null. 

 

The entire repository to our plugin is available at:

https://bitbucket.org/richardwhittemoreomf/ccrm/src/master/

 

Might anyone know what we are failing to grasp or mistake that we are doing?

 

0 answers

Suggest an answer

Log in or Sign up to answer