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!
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.
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.* FROM ( 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.
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.
Since launching the Jira Software 8.0 and Jira Service Desk 4.0 platform releases in February, many of you have been asking when the next Enterprise release will be so you can take advantage of the m...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs