Automate creation of boards through filters in Jira Server versionn

Ravi Shankar December 28, 2018

I am planning to automate the creation of Jira Board creation through filters using Jira Rest api's.  

For this i will be creating UI in jira that will have custom fields which will get the inputs from the user.

So in order to create a filter JQL  has to be given as input and initially i thought similar to basic search i can give each filter criteria as a seperate custom field and finally based on the user selection of fields i will concatenate and form the jql and create the filer. But that doesn't work out.

So now i am thinking of creating a scripted field that will mimic the functionality of advanced jql search in Jira. Is this possible and if yes how it can be achieved.Please provide example if any.Also i

If the above approach is not feasible or if that is not the best approach then kindly suggest me the best approach to get the jql filter as input from the user in a custom field in a jira screen and then validating it using java in the back end and then finally creating the filter if the jql input given by the user is valid.

What are the options to mimic the below Basic search using custom fields in Jira :

Basic Search.JPG

What are the options to mimic the below Advanced search using custom fields in Jira :

Advanced Search.JPG

Please provide the approaches and examples if any and let me know if you have any other queries.

 

2 answers

1 accepted

0 votes
Answer accepted
Ravi Varma
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.
December 30, 2018

Hi @Ravi Shankar,

I have some recommendations for you, if that suits your solution:

  • Delegate the filter creation to native JIRA UI. Use that filter name/id, as part of your solution.
  • Agile boards have other configurations, apart from filter. You may want to include them as part of your solution.
  • Please let me know, how extensively the solution will be used by end users.
  • You may want to have a look at the third party apps provided by vendors that provide these features to figure out the feature level you want to put in, in your solution. 

Regards,

Ravi Varma

Ravi Shankar December 31, 2018

Hi @Ravi Varma

Thanks for the suggestion i am planning to use Jira Rest api's to automate the process of scrum and kanban board creation through filters.

So for filter creation i am using /rest/api/2/filter this rest api which takes jql query as a parameter and i want end users to provide jql either in basic or advanced search format.For this only i asked for options to mimic the basic or advanced search in Jira using custom fields.

Already project creation part in Jira has been automated and now we are trying to add the board creation functionality in the project creation part.

For board creation i am planning to use /rest/agile/1.0/board which takes board name,type and filter id as the parameter.What other configurations are to be included apart from this could you please shed some light here ?

If i want to use the native Jira UI for filter creation should i have a text type custom field which points to the native Jira UI filter creation page and how to capture filter values created using  the native Jira UI filter in the screen which i am using to automate the jira board creation any idea/suggestions ?

The utlimate goal is to enable the end users create requests in Jira through which jira project creation along with board creation is done for them based on their inputs.

Let me know if you have any other queries.

Ravi Shankar December 31, 2018

Hi @Ravi Varma

First of all thanks for your suggestion

But i have a couple of questions :

1.If i am delegating the filter creation to native Jira UI by providing a link to the native Jira UI  filter creation page in the screen used for creation of Jira Board then how can i capture the filter name/id that is being created in the screen used for creation boards any idea/suggestions on how to achieve this?

Also what are all the other configurations apart from filter that has to be included for board creation could you please shed some light here ?

The ultimate goal of this to enable end users to raise a request in Jira that will enable them to create a project along with board through filters.Already project creation has been automated by my team and we are trying to extend the project creation functionality to include board creation as well.

For board creation i am planning to use /rest/agile/1.0/board rest api and for filter creation i am planning to use /rest/api/2/filter which takes jql as the parameter for which i need a way to get the jql from the end user.

Let me know if you have any other queries.

 

Ravi Varma
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.
December 31, 2018

Hi @Ravi Shankar,

  • Based on your goal description above, I would suggest you provide a plain text box which would contain JQL. You can test the validity of the JQL at the server side in case of invalid JQL.
  • Mimicking the native JQL functionality is a big task which would take significant effort (as the IssueNavigator advanced screen is capable of producing complex JQLs)
  • What details are you going to capture when a user raises a JIRA request?
  • You may want to explore rest api for quick filters (Though optional, you can provide default quick filters), once the board is created
  • You may want to explore the mappings between statuses and columns

Regards,

Ravi Varma

Ravi Shankar January 1, 2019

Hi @Ravi Varma

Thanks Again. I will try to use a plain text box for the users to enter they JQL and let you know how it works but if a user gives a wrong or invalid JQL how that can be validated at the server end any idea /suggestions.

For creating board through filters i will be asking the user for the filter name,filter description,jql and favorite flag for filter out of which description and favorite fields will be optional.

For fetching board details i will give board name,type of the board will be a drop down and i will fetch the filter id in the back end using rest api.

This is how i have planned let me know if my approach is correct.I tried to create boards using filterid in postman client and by default i am getting two quick filters.

quick filters.JPG

 

So according to me the hardest part over here is validating the jql in the back end can you please give idea / recommendations to validate the jql entered by the user at the server end and also let me know what i need to explore on the mappings between statuses and columns?

When i had discussion with my team they are telling that the users should be given option to create boards for existing projects as well any idea on how to automate this by using rest api's or any other ideal approach?

Most of the users will not be comfortable with advanced jql instead try to provide the basic jql search available in jira and form the jql in the back end is what they are suggesting.Any idea/suggestions on how to mimic the basic jql search that is available in the native jira ui?

Let me know if you have any other queries.

Basic Search.JPG

Ravi Varma
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.
January 1, 2019

Hi @Ravi Shankar,

You should explore  https://docs.atlassian.com/software/jira/docs/api/7.1.0/com/atlassian/jira/jql/validator/ClauseValidator.html for validating your JQL.

With regard to mimicking Issue Navigator JQL search, I would reiterate that it is difficult component to implement (irrespective of whether it is basic or advanced search) and you should decide whether you want to provide this feature to your end users or not.

With regard to creating boards for existing projects, JIRA natively provides the ability to create boards. Here also, you can leverage using new or existing filter and use that to create a board. At this point, I am curious, especially while creating boards for existing projects, how your functionality would be different from the native JIRA functionality?

If you find my solution useful, can you accept, which would motivate us to answer more community questions.

Regards,

Ravi Varma

Like Ravi Shankar likes this
Ravi Shankar January 2, 2019

Hi @Ravi Varma

I found your solution useful and i will try to implement this and let you know to which extent it works.

I am also going to create boards in the same way jira is doing but we are trying to automate this piece since only jira and project admins are able to do it now.

With respect to JQL creation initially you suggested me to use the native Jira UI and capture the filter name/id from there how can i implement this can i have a link in the screen which points to the native jira filter creation page or is there any efficient way to achieve this.

If you could suggest me some good approaches to use the native Jira UI filter creation page in the screen which i am using to get the inputs for boards and filters creation from the users it will be of great help.

Thanks a lot for all all you answers Ravi.

Ravi Varma
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.
January 2, 2019

Hi @Ravi Shankar,

Board creation permission (Create shared objects global permission can be delegated to appropriate groups). Please refer to this link to know more about who can create boards

My initial suggestion, before knowing your original requirement, was to create a filter that would serve as an input for your board.

  1. You can still apply this logic, when you are trying to create boards for your existing projects.
  2. The user would create a filter with desired JQL and permissions. The user needs to enter JQL in the box and click Save as as shown in the below image. One advantage with this approach is that the filter once created, need not be validated.Screen Shot 2019-01-02 at 3.16.02 PM.png
  3. Your UI screen shall populate the filters in a dropdown list and the user can select the desired filter.
  4. The board can be created with the selected filter (a.k.a filter id)

I would recommend to keep filter creation separate and away from your UI screens. This would work for existing projects. 

If you look at native JIRA software project creation, you will note that you can create project without necessarily thinking about the board. In the backend, JIRA automatically creates a board (Refer below screenshot) with default JQL and default permissions and configurations. My recommendation would be follow similar pattern and update the default JQL with user provided JQL (in this case, you have to validate the user provided JQL)

Screen Shot 2019-01-02 at 3.25.25 PM.png

 

Hope this answers your queries.

Regards,

Ravi Varma

0 votes
Jan Stähle August 12, 2020

Dear @Ravi Shankar

this is a very interesting feature - some of our customers are asking for. Do you intend to offer your solution or share it publicly? 

Best,

Jan

Suggest an answer

Log in or Sign up to answer