Create multipel sub tasks based on checkbox

Issue #901 new
Michael shechter
created an issue

Hi Fidel, I'm try to create multiple subtask based on checkbox custom field "תחום ביטוח" This field have three values:

1.כללי 2.ביטוח חיים 3.ביטוח בריאות

I configured the next post function:

postfuncation.png

This post- function create the correct numbers of issues, but all the sub task have the same summary as you can see in the scree-shot:

subtasks.png

A.How configure the post function that the every subtask will have one specific value in the summary? for example:

1.הקמת סוכן במערכות תפעוליות ביטוח כללי 2. הקמת סוכן במערכות תפעוליות ביטוח חיים 3. הקמת סוכן במערכות תפעוליות ביטוח בריאות

B.How can make sure that if I ran this transion again I will not get duplicat issues?

Comments (5)

  1. Fidel Castro Armario repo owner

    Hi @Michael shechter,

    You are generating multiple issues using seed strings. You can insert the seed string in new issue's summary using ^% in advanced parsing mode.

    Example: you can use the following string for the summary:

    "Sub-tasks created for " + ^%
    

    On the other hand, if you are creating subtasks you shouldn't use "Parent's..." field codes for composing the summary of the new sub-taks, since they reference the parent issue of current issue, which is the is indeed a normal issue, thus it hasn't any parent issue. You should use field normal field codes.

    In order to avoid duplicates, you can use the following string expression for generating seed strings:

    filterByPredicate(["New York", "Berlin", "Madrid"], count(filterByPredicate(subtasks(), ^%{00000} ~ ^%)) = 0) 
    

    like shown in the screenshot:

    Captura de pantalla 2017-11-20 a las 16.02.43.png

    Note that in my example I have used the following seed strings: "New York", "Berlin" and "Madrid". Sorry, but I can't even read the ones you are using.

  2. Michael shechter reporter

    Thank you fidel,

    if i use the this line : filterByPredicate(["New York", "Berlin", "Madrid"], count(filterByPredicate(subtasks(), ^%{00000} ~ ^%)) = 0)

    im getting 3 sub-tasks ("New York", "Berlin", "Madrid" ) no matter how much values im checked in the checkbox.

    create sub task.JPG

    What am I doing wrong?

    Thanks.

  3. Michael shechter reporter

    And another question,

    I try to set the Assignee of the the subtasks based on the checkbox field, so if i will checked the NewYork the assignee wiil be x and if the checked Berlin the assignee will y.

    Thank you!

  4. Fidel Castro Armario repo owner

    Hi @Michael shechter,

    Sorry, I misunderstood part of your requirements. Use the following expression for generating the seed strings:

    filterByPredicate(toStringList(%{nnnnn}), count(filterByPredicate(subtasks(), ^%{00000} ~ ^%)) = 0)
    

    replacing nnnnn with field code for your checkbox custom field.

  5. Fidel Castro Armario repo owner

    Hi @Michael shechter,

    For setting assignee based on the seed string you should use the following configuration at parameter "Set fields":

    Captura de pantalla 2017-11-21 a las 11.59.02.png

    getMatchingValue(^%, ["New York", "Berlin", "Madrid"], ["john", "hans", "manuel"])
    

    In the example, we will assign issue for "New York" to "john", and so on. Beware that "john", "hans" and "manuel" are user names, not user's full name.

  6. Log in to comment