Select new values for fields in "Create issues and subtasks" and remember old ones in parent

Issue #513 resolved
Nikola Bornová created an issue

Hi Fidel :-) I'm currently preparing new workflow for creating graphical assets - I use your awesome post function "Create issues and subtasks" on specific transition to automatically create specific issues for specific asset types (defined via Component field).

Hypothetical example - if the issue has Component "Character", the post function will create linked issues with summaries "Model", "Texture", "Animation" and "Sound".

Would it be possible to let users change/set some values on transition screen, this value would be then written into the newly created issues but the parent issue would then keep the original value? (example - Lead will select some artist as a new Assignee on transition screen, transition the issue, newly created issues would be assigned to this artist but the parent issue would still have the original Assignee)

I was thinking about utilizing ephemeral string somehow but I'm not sure if it can be done somehow for current (not linked) issue and more importantly - if the fields set on the transition screen aren't rewritten long before it gets to Post functions.

Comments (14)

  1. Fidel Castro Armario repo owner

    Hi Nikola,

    You can use "Create issues and subtasks" with a configuration like this for generating the seed strings: Captura de pantalla 2017-02-15 a las 15.07.30.png

    This is the string list expression used:

    (%{00094} ~ "Character" ? ["Model", "Texture", "Animation", "Sound"] : []) UNION
    (%{00094} ~ "Landscape" ? ["Illumination", "Music"] : []) UNION
    (%{00094} ~ "Photo" ? ["Post-processing", "Printing"] : []) 
    

    where %{00094} is field code for Components.

    This example is more general than your use case, since I have implemented 3 sets of seeds for 3 different components (Character, Landscape and Photo). This implementation will return the seed associated to the selected component. And, obviously, you may have more than one selected at the same time.

    For entering the custom field values for the new issues I recommend you to create specific custom fields like: "Assignee of new issues", "Environment of new issues", etc. that will be set in transition screen, and whose values will be used to set Assignee, Environment, etc. in the new issues.

  2. Nikola Bornová reporter

    Thanks, Fidel, you're superstar :-) The new guide works perfectly (although my actual version is much more monstrous :D ). This will save a good chunk of time to our producers and artists.

    I wanted to ask how to assign the new issues to component lead instead of null but I solved this via ScriptRunner (I created scripted field that shows lead of component in parent issue and it surprisingly works perfectly when this field is set as value for Assignee of the newly created issues).

  3. Nikola Bornová reporter

    Maybe one small thing - there seems to be problem when I want to uses Summary from parent issue in Summary of children (no matter if I use basic or advanced parsing mode). It works properly if I use for example "Only one issue"

    parents summary 1.png

    parents summary 2.png

  4. Fidel Castro Armario repo owner

    Hi Nikola,

    Is current issue (i.e., the issue that executes the post-function) a sub-task, or a normal issue?

    I have tried to reproduce your problem on JIRA 7.2.7 and JIRA Workflow Toolbox 2.2.31, and in my case the parent's summary is correctly retrieved by new issues.

  5. Nikola Bornová reporter

    Both parent and child/children are normal issues. Here is the full view of Post function setup.

    assets.jpg

  6. Fidel Castro Armario repo owner

    Parent's X fields refers to parent issue of a sub-task. As you are using linked issues for the parent-child relationship, you should use the following modification in your summary:

    • Parsing mode: advanced
    • Text to be parsed:
    "Asset child for " + first(fieldValue(%{00000}, linkedIssues("is child task of")))
    
  7. Nikola Bornová reporter

    When using transition with this parsed text for Summary, it throws:

    Summary for new issue to be created can't be empty. (seed issue: 'null'; seed string: 'Lowpoly'; seed number: null)

    I have no idea why first function throws null

  8. Fidel Castro Armario repo owner

    The problem should be that the name of the issue link type used for linking current issue (i.e., the issue that is executing the post-function) to its parent is not "is child task of".

    Please, double check the name of the issue link as it's seen from current issue.

  9. Nikola Bornová reporter

    So at the end, I solved it like this:

    ^% + " for " + %{00000}
    

    This works exactly as I need - I takes Summary of the "parent" issue and ads proper value from seed behind it.

    Thanks a lot! I finished the full version for many components and it works splendidly :-) (it even changes some custom fields in each "child" differently - using similar parsed text that is used in Description)

  10. Log in to comment