Hello together,
we created a project which is used to move unused issues into it because we don't want to grant the right to delete issues for everyone.
The current problem we have is that we have to get the old issue key from the previous project to see where the issue comes from. We want to solve this with a scripted field which sets the old project key.
I havent seen a functionality to extract the old project key over the work log.
Maybe someone can help here.
Thank you guys in advance :)
The IssueManager has a getAllIssueKeys() method that makes this pretty easy.
You could create a scripted field called "Previous Issue Keys"
And add this script:
import com.atlassian.jira.component.ComponentAccessor
def issueManager= ComponentAccessor.issueManager
def allKeys = issueManager.getAllIssueKeys(issue.id)
return allKeys.findAll{it != issue.key}.join(', ')
If you really want just the project keys, you can use this as the last line:
return allKeys.findAll{it != issue.key}.collect{it.split('-')[0]}.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.