Is there a way to replace text of multiple issues at once?

Jonas Ingenerf May 1, 2014

I'm looking for a way to replace text (a single word) in many Jira issues at once. I did not found any add-on which seems to be able to do that.

Perhaps it is possible by executing a jelly script? But I don't know jelly much.

I appreciate every hint to accomplish it without manipulating the database. The change history must not be updated.

Edit: The substitution should only be made on issues of a specific project. Additionally I have to consider all text fields (so far summary, description, comment and a custom field).

4 answers

1 accepted

0 votes
Answer accepted
Tiago Comasseto
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.
May 1, 2014

Hi Jonas, the only way I can imagine replacing just a single word is via SQL queries. As in this example:

UPDATE jiraissue
   SET DESCRIPTION = REPLACE(DESCRIPTION,'<old_string>','<new_string>');
  • <old_string>: string to search on the field DESCRIPTION, which will be replaced for '<new_string>'.
  • <new_string>: string which will replace '<old_string>'

Cheers

Jonas Ingenerf May 4, 2014

Thanks Tiago, doing it via SQL query seems the only solution.

Upon closer look I also have to filter for a specific project and replace text in some more fields (see edit).

So far I would execute this query:

UPDATE jiraissue
    SET
         DESCRIPTION = REPLACE(DESCRIPTION,'&lt;old_string&gt;','&lt;new_string&gt;'),
         SUMMARY = REPLACE(SUMMARY,'&lt;old_string&gt;','&lt;new_string&gt;')
    WHERE PROJECT = 123456;

Do you know where to get the comments and custom field values (only for the specific project)?

Thanks

Tiago Comasseto
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.
May 4, 2014

Hi Jonas,

This should give you the customfield values only for project with ID 10000:

select * from customfieldvalue where issue in (select id from jiraissue where project = 10000);

And this should return all comments:

select * from jiraaction where issueid in (select id from jiraissue where project = 10000);

I hope it helps.

Cheers

7 votes
sjoulaei January 17, 2017

I know this is old thread but it might help others that end up here with googling the same issue.

I had the same question and found an easier way to do this.

You can export the issues you want to update into a csv file. Find and Replace the texts you want in Excel or other text editors.

Then re import the file back to Jira. The key is to import from the System > External System Import  (you need admin access) menu rather than the import on the issue menu, which non Admins can access.

Make sure you have the Issue Key column in your import file and the columns that you have text update. You don't need to map any of the columns that you didn't touch.

 

1 vote
Chris Boyke June 8, 2017

I've created a Python script to do search & replace across a set of JIRA issues via the REST API:

https://github.com/cboyke1/jira_search_replace

Jeff Allison February 20, 2018

Came across this as I was searching for a solution to this problem. Your Python script saved me. Thanks for sharing, this is super useful!

Divya Yathagiri Venkata May 3, 2018

Should I be adding this script under REST Endpoints under JIRA add-ons page and execute it?

David Leal
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.
February 12, 2019

@Chris Boyke I don't a have to install Phython on my work computer. Do you know about any similar solution using an VBA excel macro for example? Thanks. 

0 votes
Mangala Janardhana November 27, 2017

Very New Here :) (and to JQL and SQL. So please bear with me)

The above query seems to be meant for specific fields like a Description or Summary in JIRA, What if the find an replace I want to do is lives in multiple test steps? across several Acceptance Criteria. Its the same project though.

Also if I just want to delete a existing phrase would this work

DESCRIPTION = REPLACE(DESCRIPTION,'&lt;old_string&gt;','&lt;' '&gt;')

Suggest an answer

Log in or Sign up to answer