You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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(', ')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.