Create Filter and Create Swimlane in Jira Automation

npollock January 5, 2021

I need a way to create a filter and a swimlane in Jira Automation.

In our Jira project I created a script that is triggered upon a new version being made that creates 5 cards and assigns a specific version to them which all works fine.

Next what I need to do is create a swimlane so that the cards can be viewed in a specific group on our board. To group the cards right now we use filters in the swimlane.

I think I need to do next is create a filter with a value "fixVersion = {{version.name}}"(Using the smart value that is in our automation script) and assign the filter to the new swimlane. So far I have not been able to find anything that would allow me to do this. If creating one or both of these is not possible but using them as a trigger is then I might switch it around and have to do 1 other step manually.

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
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 5, 2021

Hi @npollock  -- Welcome to the Atlassian Community!

Would you please explain further what you mean by "triggered upon a new version being bad"?  For example, is there something wrong with the created version?

There is no way built-in way to dynamically add a filter or swimlane yet with automation.  There are several related suggestions which you may review and vote for:

As you have the issues when you assign them to a version, I wonder if there is something else you could set that would allow a generic swimlane filter.

I haven't tried this, but I wonder if you could create one filter for a swimlane, and then edit the filter from the automation rule using the REST API:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/filter-editFilter

 

Best regards,

Bill

npollock January 5, 2021

First off thank you for the fast reply!

Sorry that "bad" was supposed to be "made" I think I fat fingered it or something.

We don't have any issues with our workflow, I am just trying to automate it to save us some future time. We are on a new project about every 2 weeks so what I have already is going to be worth it in a month or 2.

I read up on the rest API for around 15 minutes but I was a bit confused. Ill look into it more and see if I can do anything with that.

Bill Sheboy
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 6, 2021

This article on how to call the REST API from an automation rule will help if you go the route of dynamically changing the filter:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Bill Sheboy
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 6, 2021

Very cool... I just tried this using the REST API to dynamically update the filter from an automation rule and it worked, following the above instructions.  :^)

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2021

If you think that's cool...

I used the REST API to allow us to use Project Entity Properties as a lookup table (if field1 = X and field2 = Y then set userfield1 to Z).

It's a little more manageable than rules with a bunch of IF blocks, but having to lookup user account IDs is a pain.

I was exploring the idea of actually setting the properties from Automation Rules itself (supported!), but the rules (and attendant workflow/issues for "mappings") would have to live in the same project, which is not optimal.

1 vote
Tom Williams
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 6, 2021

Hi @npollock

@Bill Sheboy is correct - no way to automate the display of the scrum or kanban board. The way I'd tackle your problem is to create a generic but dynamic filter on the board you use taking advantage of JQL. 

For example... 

if you work as we do and only ever have one fix version unreleased you could use this JQL query to create the swimlane: 

fixVersion in unreleasedVersions(PROJECT) 

if you have multiple fix versions in the unreleased status and follow a regular pattern you could build on this JQL, 

fixVersion in unreleasedVersions(PROJECT) and fixVersion ~ "X*" 

Hope this helps. 

npollock January 6, 2021

we have 15ish swimlanes at the moment which are each their own "project"(not in the jira sense but for our client). We have another board that is just every project combined which is just every card on one swimlane similar to your second solution.

Tom Williams
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 6, 2021

Sounds like you dont want any more swimlanes! Perhaps the solution is just a quick filter on your board to return the issues with the latest fix version created. 

Bill Sheboy
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 6, 2021

Hi @Tom Williams 

When I tried the partial match on fixVersion, I got this error:

The operator '~' is not supported by the 'fixVersion' field.

Did that work for you?  Thanks!

Tom Williams
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 6, 2021

Ah.....I hadnt thought about this. Its possible with Adaptavist scriptrunner add-on. 

 

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events