Script for Calculated Number Field for Jira Misc Custom Field 1.6 version

vishwas August 21, 2019

Hello All,

We are having Jira Software 6.3 version and Jira Misc Custom Field(JMCF) 1.6 version in our production server. But in Test Server we have Jira 7.13.5 and JMCF 2.1.5 where we have written a script for counting the number of open bugs for linked Issues.

Below is the script for the calculated Number field created via JMCF 2.1.5 and it's working fine.

int x = 0
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def linkedIssues = ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, currentUser).getAllIssues()

if (linkedIssues.size() > 0){
for (int i = 0; i < linkedIssues.size(); i++){
if (linkedIssues[i].getIssueType().getName() == "Bug" && !linkedIssues[i].getIssueObject().getStatusObject().getName().equals("Done")){
x = x + 1
}
}
}
if (x > 0){
return x
}else return null

Can anyone please help me with the above script for JMCF 1.6 version.

We want to immediately apply the changes in the production Jira to see those fields in the reports, as Upgrade is not planned immediately.

 

Thanks much,

Vishwas

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events