The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Cleanup custom issuetypes

Erik Mathijs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 17, 2022

As preparation of my migration from server to cloud, i want cleanup some issuetypes and some issue statusses.

Because i don't want to loose information about the issue's, i want to keep thisinformation in the issues by creating a custom fields for holding the status and name of my issueType.

So my plan is to create custom fields

-  old_issue_type and populate it with the name of the issuetype. 

- old_issue_status and populatie it with the status of the issuetype

 

After this operation, i will move the issue's of issueType A to a general issuetype, with a screen with all fields.

If i can arrange this, i can cleanup a lot of obsolete issueTypes and obsolete statusses.

For example

Issuetype = A / Status = X

Custom field 

- old_issue_type must be populated with value A.

old_issue_status must be populated with value X

 

Question

Question is how do i save the value of issueType name and status in the new created custom fields.

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 17, 2022

You will need to manually bulk edit each status/issue-type combination.

If it were me, I think I'd write a script to do it (obviously, you'll need a scripting app to do it, or writing something that can do it over REST)

Erik Mathijs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 18, 2022

Hi @Nic Brough -Adaptavist- 

We have a license of Adaptavist Scriptrunner, can you provide me a script for populating

- a custom field with the issue type

- a custom field with the status

This would help me a lot.

I'm not familiar with writing scripts in Scriptrunner, but perhaps you can help me with this.

Thanks in advance !

Erik

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 18, 2022

This is a snippet that tells you how to write to most custom field types - https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console

This one runs a search (you'll probably want to run a search like "project = X" and iterate over the results to copy the data into the custom fields) https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console

I'm not sure what you're aiming to store - status and issue type are objects, not simple strings, and I don't know if you're looking to store their immutable id, or the current name (the string the users see on screen), or something else.

But if it's the name, then you can fetch that with 

def sname = issue.getStatus().getName()

def iname = issue.getIssueType().getName()