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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

685 views 6 13
Read article

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