Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to pull specific values out of a history using JMCF

Joe Harmon
Contributor
October 2, 2019

I am using JMCF (jira misc custom fields) and I wanted to create a calculated scripted text/html field that represented the key history of any previous key associated with a given issue. These keys are kept in history but I wanted to be able to pull them out and separate them my a comma or a space.  For example: BETA-123, CORE-334, PRO-111

I can get the information using issue.getFieldHistory("Key") it it also includes all the other history information with it.

1 answer

1 accepted

0 votes
Answer accepted
Joe Harmon
Contributor
October 7, 2019

I used the groovy script found here: https://community.atlassian.com/t5/Jira-questions/Display-previous-key-of-moved-issue/qaq-p/406633

However, I did modify it and shorten it.

import com.atlassian.jira.issue.IssueManager;
IssueManager issueManager = ComponentAccessor.getIssueManager();
tickets = issueManager.getAllIssueKeys(issue.id)
if (tickets.isEmpty()) {
return null
}
return tickets.join(', ')

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events