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.
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(', ')
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.