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

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

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.

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.

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

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,399 views 2 7
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you