ScriptRunner - How to get a project name if I know the board ID

Roberto L
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.
September 21, 2017

Hello Community,

I am trying to retrieve the name of a project in Jira. In my current script I only have access to the id of a board that is associated with the project.

I wanted to know if there was a function or object that I could pass my boardID and that would return the information associated with the Board, perhaps the project key, project name, issues inside board, etc.

Any help on this is greatly appreciated!

-Roberto

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2017

It's not that simple - boards are only associated with projects by their inclusion in the board filter.  And a filter can say "project in (ABC, DEF, XYZ), so you'd have to handle multiple projects.

What is your script trying to achieve for the users?

Roberto L
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.
September 22, 2017

Hi @Nic Brough -Adaptavist-,

I am using a webhook that sets off once a Sprint is deleted. I process this webhook through a Rest endpoint.

because the Sprint is deleted all the information I get from the webhook is the Sprint Name and Id, as well as the boardID and user who triggered the event.

What I am trying to do is somehow fetch what project that sprint was as I need information from the project such as the roles associated with the project and then name of the project. My initial thought was using this boardID to find such project. 

Would you know anyway to accomplish this?

-Roberto

Roberto L
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.
September 22, 2017

Hey @Nic Brough -Adaptavist-,

Question for you, would a Sprint Deletion be considered an Update for a Project?

 

-Roberto

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2017

Um.  Again, a board (and hence a sprint too) can include many projects.

You'll need to read board for its filter and then parse the filter to work out the project(s) clauses, or issue types that only exist in certain projects, etc.

Deleting a sprint is not a project update.

Roberto L
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.
September 29, 2017

Hi @Nic Brough -Adaptavist-,

Would you know the code that would allow me to fetch a board when I know its boardID number and from there fetch the filters inside it?

-Roberto

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2017

I seem to remember that it's board.getQuery() for a query with IDs, or boardGetNavigatorQuery() for the more human friendly one.

Suggest an answer

Log in or Sign up to answer