Trigger Update of a GitHub Repository Index

nnichols June 9, 2020

Hello,

I have a use case where users regularly create new GitHub repos, but when they go to create a new branch in a newly created repo it does not show up in the list of available repos to branch from.

The manual fix for this is to go into the settings an click on "Rebuild Index" then the repo will show up in the "Create Branch" search box.

Is there a way to:

  1. trigger the rebuild of an index when a new repo is created in GitHub
  2. trigger the index rebuild programmatically through a REST call
  3. another approach?

Cheers,

Nolan

2 answers

0 votes
David Labra Gaona June 19, 2020

Hi Nolan,

I haven't heard from you in a while.

The repositories will be reindexed according to the Reindex interval option found in the General Settings page if you are on Jira Server or Data Center. For Jira Cloud, this interval may very according to the repositories usage.

Sometimes, it is needed to trigger a reindex immediately once a change is made in your GitHub repositories. That is why we offer the webhook option. When you create a webhook, every time you commit changes, create branches, create pull requests or merge pull requests, those changes will trigger the reindex of the specific repository you are working on.

Now, let me answer your questions:

1. trigger the rebuild of an index when a new repo is created in GitHub

It is not possible to trigger a reindex when a repository is created in GitHub. But once the repository is created, the webhook configured and you make some changes, that will trigger a repository reindex in Jira. If the repository doesn't exist in Jira, it will be scanned.

2. trigger the index rebuild programmatically through a REST call

Yes, for Jira Server and Data Center, we offer a REST API to trigger repository reindexes at will. With this approach you need to know the repository id. You will find more information here.

3. another approach?

No, the previous are the 2 possible approaches.

 

Please, let me know if you have any follow up questions, or if you prefer, you can create a new ticket in our support page.

Cheers,

David

0 votes
David Labra Gaona June 9, 2020

Hi Nolan,

I'm with BigBrassBand - the vendor supporting the Git Integration for Jira app. By the provided details it seems you are using Jira Server or Data Center. Could you confirm this?

Also, If you would prefer to continue this privately - contact us at support@bigbrassband.com.

Cheers,

David

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events