Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change Repository links programmatically/in bulk

Christian B_
November 11, 2025

In the "Repository links" section of the "Repository settings", we have "Custom" links configured for JIRA ticket mentions.

E.g., given one our JIRA projects might be "XYZ", then

Custom ((?<!\w)((XYZ)-\d+)(?!\w))

would be configured as linking to

https://ourjira.domain.org/browse/\1

Problem is that, across our hundreds of modules, the links are not consistent (e.g., some will rightfully have other projects in the pattern, e.g., Custom ((?<!\w)((XYZ|ABC|DEF)-\d+)(?!\w))). Some repositories even have a wrong server configured in the links; some have both the right and the wrong one.

Unfortunately, it is unclear how these links have been configured in the first place. However, we would like to consolidate them without clicking through every repository.

Is there a way to modify the links via the REST API? The documentation does mention "links" in examples, but it is not clear to me if these are the links in the settings or something else entirely.

I apologise if I have missed a stated solution - the search term "repository links" etc. just isn't very specific ...

Cheers

C.

 

1 answer

0 votes
Aron Gombas _Midori_
Community Champion
November 12, 2025

@Christian B_ If I were you, I would do this:

  1. Pick a repository for testing purposes.
  2. Set its repository link to "https://www.mytestlink.com".
  3. Get the repository through the REST API.
  4. Search for "https://www.mytestlink.com" in the returned JSON.

If you can find this string, then you identified the JSON field which stores it.

Christian B_
November 12, 2025

Hey, of course, good idea, thanks - I'll try that and let you know how it went.

Like Aron Gombas _Midori_ likes this
Christian B_
November 25, 2025

It turns out that, unfortunately, it these links are not included in the repository's JSON description.

I have checked the "top-level" JSON (at https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}) for my custom link, as well as a few of the sub-level entries, even though none of them really sounded related (e.g., ".../hooks").

As far as searching the REST API description for further possible points of entry goes, "links" is obviously not a good search term, and I am not even sure it would be the right one for these links, so I am not 100% sure I might have missed something, but I guess it seems this is not editable via the REST API.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events