It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA Custom Field for Fix Versions

Hi all,

I have inherited a situation where there were custom fields created called "Found in release"  and "Fix in Release".    Fix version/s and affected version/s are empty. 

To take advantage of all of JIRA's links and tools I would like to undo this, and move all values in "Found in Release" to "affected version/s" and all values in "Fix in release" to "fix version/s".  

I would assume a database "hack" (or copy really) could probably accomplish this but I am not a DBA.

Any ideas on how best to accomplish this.

Thanks in advance!


4 answers

1 accepted

2 votes
Answer accepted

Can you create transitions from each status back to itself and make the assignments in post-functions, then do Bulk Transitions? Tedious, perhaps, but safer than messing with the DB.


So you have to do this for each and every status, for each and every workflow, and for each and every project? If so wow, that would be over 100 new transitions. And then I would have to transition each issue through that transition? Can I do that? So here is my concern, I have 20 status's per workflow, status 1 has a transition called move-fields, status 2 has a similar transition. Can I bulk transition Issues in status 1 to status 1's move-fields and and issues in status 2 to status 2's move-fields at the same time? Or would each one have to be done separately? It may be easier to go into each and every issue and just copy the field. I think this would be a great plugin. Copy field, that for whatever projects specified, takes all the issues in each project and has a from field and a to field (they would have to be the same field type of course.)

With that amount of transitions, extremely tedious, granted. Not sure if there are any plugins that will do the trick, but maybe someone at your site can write something using the JIRA API? Find the issues to modify using a filter, then one by one read the issue, update the fields. I have used Python scripting and others in the company use PHP, both work fine. Once complete, maybe create post-functions on Create transition(s) to copy the fields as long as some people are set in their ways.

Maybe scriptrunner can be used, I've never tried using it myself to run scripts outside of transitions.

I am the Atlassian resource here. I do know python and shell scripts. Possibly use Bob's CLI with some scripting to copy it. Hmm... Thanks, will give it a try.

The SQL solution is fairly straightforward, I've done it for the transition in the other direction (FixVersion to a Custom Field).  However, it will require digging; I can provide the 'other direction' sample, but someone will have to figure out the IDs of the custom fields and the appropriate sub-SELECT for the insert.  Example:

insert into customfieldvalue (
select @rownum:=@rownum+1 as rownum, cfv.*
 select source_node_id as issue,
 (select id from customfield where cfname='Release Version/s') as customfield,
 null as parentkey,
 null as stringvalue,
 sink_node_id as numbervalue,
 null as textvalue,
 null as datevalue,
 null as valuetype
 from nodeassociation
 where source_node_id in (select id from jiraissue where project in (10,11,12) and issuestatus in (5,6))
 and source_node_entity='Issue'
 and sink_node_entity='Version'
 and association_type='IssueFixVersion'
 and sink_node_id in (select id from projectversion where project in (10,11,12) and vname not like '%Sprint%' and vname not like '%Backlog%' and vname not like '%.x')
 and (source_node_id,(select id from customfield where cfname='Release Version/s'),sink_node_id) not in (select issue, customfield, numbervalue from customfieldvalue)
 ) cfv,
(SELECT @rownum:=(select max(id) from customfieldvalue)) r
update SEQUENCE_VALUE_ITEM set SEQ_ID=(select max(id) from customfieldvalue) where SEQ_NAME='CustomFieldValue';

There are some optional restrictions here; for example, we didn't want to copy Sprint or Backlog versions.  A "copy all for all projects" would be more straightforward.  Basically, you'd insert into nodeassociation a select from the appropriate customfield value, once for Fix Version/s and once for Affect Version/s.  If you need help with it, I can probably work out the exact SQL for an unfiltered dump, it would take about half an hour, give or take.

Wow thank you. I can get the custom field IDs, but am still a little shy of doing it through the MySQL DB. I write pretty advanced bash scripts and so I will give that a try first with Bob Swift's CLI. Seems straight forward. Foreach issue that meet criteria, Version=`read field Release version`, set Fix version/s to $Version.

Not an answer, but a +1 for the question.  I have a custom text field that holds the value of Affects Version and I want to copy that value into Affects Version for all projects. Appreciate any guidance


Sorry, more or less a repeat of my old answer.

Unless you want to do scripting, here is a possible but cumbersome workaround. For each status in the workflow where you have this issue, create a transition that goes back to the same status, copying the values from both custom fields to the system fields in post-functions.

Maybe add a condition on who can run this, but it shouldn't hurt anything and would be idempotent as long as no one modifies the custom fields.

Test on an issue or two because I'm not sure how the copy from a text field into a version field works, then do bulk transitions.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Calling all Jira Cloud users! Give us feedback on our exploration of a new navigation.

Hi everyone! My name’s Matt and I’m a product manager at Atlassian. I work in the navigation & findability space for all our Jira Cloud products. We’ve been working on trying to improve the exp...

1,051 views 16 12
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you