How to automatically update custom field value for all exisitng issues of the project if Context is

nitesht87 January 5, 2018

I have a drop down custom field  "ProjectGroup" and I have created a separate context for projects with some default value.

 

For Example: Context 1

Default Value = A

Projects : Project 1, Project2 , Project 3.

 

Context 2

Default Value = B

Projects: Project4, Project5 , Project6

 

Now If I move Project1 from Context1 to Context2 , I want custom field value of all existing issues of project 1 should get updated to B.

 

Is there any way to achieve this?

 

 

2 answers

1 vote
Radek Dostál
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 Leaders.
January 5, 2018

Hello,

 

Default value based on context does not "stick" - once an issue has a value set, it's set and it no longer has any connection to the context. Default value setting is only valid for when a new issue is created and ends there.

 

You would therefore need to update those issues separately.

 

Best regards,

 Radek

 

// edit

I see some suggestions on how to update the values.

 

If it's a single-select field, you can make do by filtering the issues out in an issue navigator and performing a bulk update on them.

If it's a multi-select, bulk update is not good - it would erase the other values if there're more than 1. In this case, without add-ons, I find it better to download the issues as .csv, modify the needed value, and upload it back via .csv import afterward. That way you only update a single object retaining the others.

 

Anyhow, if you're not sure about the outcome, I whole-heartily suggest to test the whole context change somewhere safe first. You can actually erase the values if you don't plan ahead.

Alexey Matveev
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 Leaders.
January 5, 2018

@Radek Dostálgood point about bulk update and csv. I totally forgot about it. Thanks

nitesht87 January 5, 2018

@Radek Dostál  updating issue via bulk upload is a manual effort. I want changes to to get apply automatically so that if anyone forget to bulk update after changing the context then it will not create data issue.

0 votes
Alexey Matveev
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 Leaders.
January 5, 2018

Hello,

It would be nice to know if you are on Cloud or Server.

But basically If you want an out of the box solution, you could develop a plugin to do the task or use Jira Rest API (You would need to iterate over all issues which must be changed and then update the issues one by one). Or you could use an add-on which will let you write such tasks easier. There are a few like this in the marketplace. For example, Power Scripts. You can find more information here about Power Scripts.

https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.jjupin/server/overview

If you need any further help, kindly ask.

NT January 5, 2018

We are using Jira server..

That is a paid plugin :(

Alexey Matveev
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 Leaders.
January 5, 2018

That is right. You can try to look for other plugins. Try Automaion Lite for Jira. I guess it also can do the trick. There is a lite version which is free:

https://marketplace.atlassian.com/plugins/com.atlassian.plugin.automation.jira-automation-plugin/server/overview

You will have to create a scheduled job and then provide JQL query for issues which you want to change. Then you choose the edit issue action and set  the required by you field. That is all.

nitesht87 January 5, 2018

@Alexey Matveev Thanks for the info. I will try Automation Lite

Suggest an answer

Log in or Sign up to answer