Do not worry, we do not want to use due dates to add tasks to a sprint!
We have Kanban teams delivering assets to agile teams, and we want to use this method to tell agile team in which sprint they can expect a Kanban delivery.
After some research I have found a thread that almost got me to a solution, thanks to @Bill Sheboy helpful set of links.
Using the information provided I was able to send the right web request through the REST API and get a list of sprints to iterate over.
Then using smart values I can iterate through the list of sprints and log all their names and startDates,
{{#webhookResponse.body.values}}{{name}} -- {{startDate}} {{/}}{{/}}
I also tested that the due date on the test issue is fine, by just logging
{{issue.dueDate}}
Now it seems I am missing one last bit of smart values syntax. From what I can tell once you are in an iteration loop all the smart values within the loop seem to assume they are children of what you are iterating over. Let's see if I can explain this better.
Say I have 5 sprints and I iterate over them in the webhookresponse. if I print text it will just appear five times in the log. Like so:
{{#webhookResponse.body.values}} repeat this {{/}}
Now if I do the same with the dueDate it doesn't work.
{{#webhookResponse.body.values}} {{issue.dueDate}} {{/}}
The same way I was accessing the sprint start date using {{startDate}} smart values seem to assume {{issue.dueDate}} is a sprint parameter. Is there a way to access other smart values while iterating?
The idea was to trigger this rule when the due date is set on a Kanban asset, then iterate over the future sprints to find the one corresponding to that date, and save it is a "expected in sprint" custom field. But while iterating over sprints I cannot figure out how to access the due date...
Haven't fully tested the syntax but if would have to be something like this:
{{#webhookResponse.body.values}}
{{#if(issue.duedate.isAfter(startDate))}}
{{#if(not(issue.duedate.isAfter(endDate)))}}
{{name}}
{{/}}
{{/}}
{{/}}
Mind you I may be approaching this filtering problem from the wrong end?
Hi @Eric Brown
First things first: I do not believe your scenario can be solved with an automation rule only. Instead you may need to write an external service with another programming language, given your issue dates, to find the sprint, and then call that service from the rule.
----------------------------
More on your observations...and why this may not be possible for your scenario.
You are correct: once inside of an automation rule, list iterator...only data from that scope and lower is visible. My understanding from other community threads is Atlassian has tried to address this limitation and was unsuccessful.
So, one work-around for the iterator limitation is...
While this syntax does not allow data access outside the list:
{{#someList}}{{#if(some condition with field from outside)}}some data{{/}}{{/}}
You can try this using the inline iteration approach:
{{someList.match(some regular expression using field from outside).text functions to parse the results}}
The challenge is structuring the list data in such a way so it can be matched, writing a regular expression that can help, and then later parsed to extract your information. But that may not be possible for your bracketing of the dates to create such a regular expression...Or, I cannot see how to do it.
Kind regards,
Bill
Hi Bill,
Thanks for you quick reply on this. I felt I was so close, but then hit this limitation...
I can probably resolve this super quickly using a python script, and will have to see where to put it so that we can invoke it through a web hook. I was hoping to avoid this, but once I have enabled python in my setup it should open a lot more doors, so I guess it is a good investment.
Thanks for all your contributions to this forum btw!
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eric Brown ,
I did have the similar issue to iterate over future sprints. Just following @Bill Sheboy in various threads, I came across this one. I would really be grateful if you share some insight about how you managed to solve it. I can provide help in writing python functionality.
i need to understand what actually it means writing external service.
br,
alok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alok!
Unfortunately I have not had time to look into this further. The python part should be fairly straightforward, but the webhook will require some setup work. I will try and remember to update this thread if I get to it in the near future.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.