How do I search and replace a URL in a custom field?

Deleted user January 4, 2016

I have a custom field that has a URL to a web site that is different for most JIRA tickets, but the domain is always the same. the domain has changed so now I need to modify the URL so that it points to the new domain. The rest of the URL remains the same. I would like to bulk edit and replace the domain in this custom field. How do I do that. 

 

Thanks. 

2 answers

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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 4, 2016

You can use the JIRA Command Line Interface (CLI), but you will need a bit of scripting as it doesn't support a find/replace update at this time. You will need to:

  1. use getFieldValue to retrieve the current value of the custom field
  2. use script to modify the value to replace the domain name
  3. use setFieldValue to update the value of the custom field
  4. use getIssueList so you can iterate over each of the issue that need to be updated

 

0 votes
GabrielleJ
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 4, 2016

Your option is very limited here since you are in the cloud. I can't think of any other way than to do a Bulk Update (https://confluence.atlassian.com/jira/modifying-multiple-bulk-issues-185729606.html). 

How many issues do you need to move? You can code something to make the change via the REST API.

Deleted user January 4, 2016

I looked through that documentation. What I have is a url like this: "https://<domain1>/testrail/id123456"; and I need to change it to "https://<domain2>/testrail/id123456"; I did not see anyway to change just a portion of the URL can you point me to this if there is something available? Or if not then Perhaps I can code to the REST API if you get me that documentation. thanks, Rich.

GabrielleJ
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 4, 2016

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events