transition an epic automatically when all linked stories are complete

Issue #653 resolved
Scott Federman created an issue

I apologize as this may be easy but i am not a developer. Im trying to use a post function to automatically transition an epic when all linked stories have been completed. Can you help me with how to do this?

Comments (12)

  1. Fidel Castro Armario repo owner

    Hi @Scottfedm,

    You should insert "Write field on linked issues or subtasks" post-function in transition to "Completed" status in your stories workflow with the following configuration:

    Captura de pantalla 2017-07-04 a las 13.23.16.png

    • Conditional execution:
    count(filterByStatus(linkedIssues("is Epic of", linkedIssues("has Epic")), "Completed")) = count(linkedIssues("is Epic of", linkedIssues("has Epic"))) - 1
    

    Note that:

    • I'm assuming that you want to move your Epic to In Progress status. You should enter the actual name of the status you want to move your Epic to.
    • Completed is the name of a status in your stories workflow.
    • You should take care of writing it exactly. You can check the name of the status at Administration > Issues > Issue status, since JIRA's UI always shows the status in upper case.
  2. Scott Federman reporter

    Ok what if we were calling the epic issue type a “Migration” instead and using the link type “Relates”?

    Thank you,

    Scott Federman Addteq Team Lead/JIRA Administrator/Process Enhancement & Solutions Expert (O) 919.694.9293 (C) 215.350.8664

    [https://ci4.googleusercontent.com/proxy/vdGprIG-usiAMows9ByruTUylm9OW2beJivmBtp5NEAG0GgOAYUjKG7nsXf2QlMmaRbZYA=s0-d-e1-ft#http://i.imgur.com/fINpFqm.png] Addteqhttps://www.addteq.com/ | Atlassian Platinum Solution Partnerhttps://www.atlassian.com/partners/search?name=Addteq&page=1 | Cary, NC Twitterhttps://twitter.com/addteq | LinkedInhttps://www.linkedin.com/company/addteq | Facebookhttps://www.facebook.com/Addteq/

  3. Fidel Castro Armario repo owner

    Use the following boolean expression in parameter Conditional execution instead:

    count(filterByStatus(filterByIssueType(linkedIssues("relates to", filterByIssueType(linkedIssues("relates to"), "Migration")), "Story A, Story B, Story C"), "Completed")) = count(filterByIssueType(linkedIssues("relates to", filterByIssueType(linkedIssues("relates to"), "Migration")), "Story A, Story B, Story C")) - 1
    

    where "Story A", "Story B" and "Story C" are the issue types of the stories. This is an example. You can use the number of issue types you want. Simply take care of writing the names of the issue types exactly.

  4. Hendrik Korte

    I have a similar question, i want a post function to automatically transition my issue in to the Status Done-Check, when all linked Issues of the type "development order" ar in the Status "Completed". When I use your text I get Syntax errors. Note that they are using different Worklflows.

    Sorry for the probably stupid question and for my bad english and thank you for your work!

  5. Fidel Castro Armario repo owner

    Hi @Korsche,

    Sorry, I mistakenly put the boolean expression in parameter Text to be parsed... when it should be put in parameter Conditional execution.

    Parameter Text to be parsed... should contain the name of the status you want to move the Epic issue to.

    I have edited my 2 previous post in order to correct the mistakes.

    Let me know if you have any problem to implement your use case.

  6. Hendrik Korte

    Hi, another question, it's linked with the question above. At the moment i followed your instructions but nothing happend in my linked Issue. I think it's because my IssueTyp is an custom Typ. It is possible to declare an custom Typ as an equivalent tpo the Epic's

    Sincerely, Hendrik

  7. Fidel Castro Armario repo owner

    Hi @Korsche,

    There are several ways to implement the behavior. It seems that you have used a validator to block transition while there are Development Orders still not Completed.

    The other way to do it is to use a boolean expression in Conditional execution parameter at "Copy a parsed text to a field" post-function.

  8. Hendrik Korte

    Yes thank you both methods are working fine. But now I have another question. I want to transition an issue ,when it is due in 2 weeks. To move it from the stock to chek up. It somethiong like that possible? Thanks againg for your quick response.

    Sincerly, Hendrik

  9. Fidel Castro Armario repo owner

    Hi Hendrik,

    You can use Write field on issues returned by JQL Query or Issue List with the following configuration:

    Captura de pantalla 2017-06-23 a las 17.24.22.png

    You should insert the post-function in one or more transitions that you execute at least once a day. This way you ensure that every day the issues due in 2 weeks are transitioned.

    It would be more elegant to implement it as a cron triggered service, but that's not currently supported JWT.

  10. Fidel Castro Armario repo owner

    Hi @Scottfedm,

    In my original post I used the wrong post-function. I have updated it with the correct one. Sorry, for the mistake.

  11. Log in to comment