Copy Component field value from Epic

Issue #327 resolved
IT MayaHTT created an issue

Hi Fidel,

I'm scratching my head to find what is happening here.

I have a workflow in which I specify to copy value from components to components when the issue has a Epic. So far so good, until I use the Jira feature shared configuration to share the same schemes in two of my Jira projects.

At this point, the copy components to components won't work. However, I also have Watchers to Watchers, and a few others fields and for those the copy work with no issue.

Do you have a clue of what the issue could be ?

I did try the following :

Update parameters of the Read fields from linked issues or subtasks Function

Text parsed in advanced mode %{Components} in linked issues or subtasks will be copied to field Components in current issue, filtering issues by: Inward issue link types: has Epic. Outward issue link types: none Subtasks won't be read. Sibling subtasks won't be read. Issue types: any Statuses: any Linked issues or subtasks may belong to any project. This feature will be run as user in field Current user.

Where the parsed field is %{00094} (Component), I even tried %{00095}. I also try "field in linked issues or subtasks" from components to components (this used to work), but no luck.

Any help would be appreciated :)

Have a good one. Jonathan

Comments (22)

  1. Fidel Castro Armario repo owner

    Character ^ should precede field code %{00094}, i.e., you should use the following source value:

    ^%{00094}
    

    Otherwise the value your are reading is the components from current issue, not from linked issues (as you intend to do).

    Anyway, I find simpler and more natural to use the following equivalent configuration for source value:

    • Source type: field in linked issues or subtasks
    • Value: select field "Components".
  2. IT MayaHTT reporter

    Thanks for your answer.

    Indeed, I've missed the ^ but it still doesn't work. I agree with you it's simpler to use :

    Source type: field in linked issues or subtasks Value: select field "Components".

    But in my case, this doesn't work anymore. Could it be due to the fact that I share this workflow with 2 projects for an obscure reason.

    Jonathan

  3. Fidel Castro Armario repo owner

    Are components with exactly the same names present in both projects?

    BTW, use "parsed text (advanced mode)" instead of "field in linked issues or subtasks", since the first approach uses component names, while the second approach uses components IDs, and since those are 2 different projects, they have different component entities although the share the same name.

  4. IT MayaHTT reporter

    Yes since the schemes are identical both projects use the same exact fields. In this case, we only create issues in the same project.

    With "parsed text (advanced mode)" and using ^%{00094}. Not working :(

    See attached screenshots : ScreenShot004.jpg ScreenShot005.jpg

  5. Fidel Castro Armario repo owner

    Components are not defined by schemes.

    When a project is created using "Create with shared configuration" feature Components are not copied, i.e., the new project doesn't have any project until you create them manually.

    Please, check whether components with same name do exist in both projects.

  6. IT MayaHTT reporter

    I know, but I'm not trying to create issues between these two projects. I'm only creating issues in an Epic in the same project, and the Epic has the Component set but the issue doesn't get the value (and used to work).

  7. IT MayaHTT reporter

    Sure, screenshots attached. You'll see I do have a few "Copy Value From Other Field" for fields to be copied from Task to Sub-tasks, this works fine.

    Thanks for your help !

    Post-function1.jpg Post-function2.jpg

  8. Fidel Castro Armario repo owner

    Jonathan,

    Please, try removing post-function 9, since it's overwriting field Components in current issue, and this way it's spoiling the work done by post-function 2 previously.

  9. IT MayaHTT reporter

    Hi Fidel,

    Thanks you got it right ! It's now working but I don't have my sub-tasks getting Components fields copied now. Is there an additional setting I could set in the same post-function ?

    John

  10. Fidel Castro Armario repo owner

    You can do it like this:

    1) Remove the post-function you are currently using for setting "Components" on subtasks.

    2) Edit post-function 2 changing target field to "Ephemeral string 1".

    3) Add "Copy a parsed text to a field" post-function in position 3 with the following configuration:

    • Target field: Components
    • Parsing mode: basic
    • Text to be parsed: %{00061}

    Note that %{00061} is field code for "Ephemeral string 1".

    4) Add "Write field on linked issues or subtasks" post-function in position 4 with the following configuration:

    Captura de pantalla 2016-05-31 a las 19.54.06.png

    Leave empty the rest of parameters not shown in the screenshot.

  11. IT MayaHTT reporter

    Fidel,

    I did what you suggested but I still don't have my sub-tasks getting Components fields copied. Here is what I currently have in my testing workflow :

    ScreenShot004.jpg

    Thanks ! Jonathan

  12. Fidel Castro Armario repo owner

    Which workflow is this? In your previous screenshot there are 17 post-functions, while in this one you only have 5.

    The description of the solution I gave you was intended to be implemented in the workflow you showed me in first instance. Anyway, now I become aware that you didn't have a post-function in that workflow to copying Components to subtasks. Can you explain it, please?

  13. IT MayaHTT reporter

    Sure the explanation is quite simple :) Since my project where I'm trying to this is on production, I'm doing the tests on development instance.

    I was able to reproduce the issue with the only 5 post-functions you can see in the previous screenshot. That's why you cannot see the post-function to copy Components to subtasks, because you asked me to remove it.

    Just to make sure, I've also done the suggested modifications on my production Workflow with no luck, works for tasks created that have Epic, but not for sub-tasks. Works the same way with my test workflow.

  14. Fidel Castro Armario repo owner

    Using that configuration with 5 post-functions, is Components field in current issue (task with an Epic) updated with the value from its Epic?

  15. Fidel Castro Armario repo owner

    Jonathan, there is something I don't understand:

    How is it possible to copy Components from task to sub-task in task's creation transition, since at the moment of task creation it can't have any sub-task yet?

  16. IT MayaHTT reporter

    Hi Fidel,

    Sorry that I got you confused !

    To answer your first question :

    Using that configuration with 5 post-functions, is Components field in current issue (task with an Epic) updated with the value from its Epic? -> Using the 5 post-functions workflow. Yes the Components field is getting the value correctly when it has an Epic and get the value from its Epic. But I'm not getting the value from Task to Sub-task.

    Second question :

    How is it possible to copy Components from task to sub-task in task's creation transition, since at the moment of task creation it can't have any sub-task yet? What I'm trying to do is to copy the Components field from task to sub-task in Sub-task creation. Isn't it playing the workflow while creating a sub-task ?

    I want it at the Task creation when it has an Epic (getting the value from its Epic) AND when creating a sub-task (when task already exists, getting the value from the existing task/parent).

  17. Fidel Castro Armario repo owner

    Ok, Jonathan, now I understand. You can set subtask's Component field from their parent issue adding "Copy a parsed text to a field" post-function to Create Issue post-function in subtask's workflow with the following configuration:

    • Target field: Components
    • Parsing mode: basic
    • Text to be parsed: %{00095}

    In case you are sharing the same workflow with tasks and subtasks, then you should set parameter Conditional execution with the following boolean expression:

    %{00041} != null
    

    Note that:

    • %{00095} is field code for Parent's components
    • %{00041} is field code for Parent's issue key

    Don't apply the solution in 4 steps that I provided you previously, since I didn't understand correctly your scenario. You should simply use "Read fields from linked issues or subtask" selecting Components as source field and as target field.

    Another advice: since version 2.2.11 you can simply select Replicon as source and target field, i.e., you don't need to use a composition with advanced parsing mode for cascading select fields, as in previous versions.

  18. IT MayaHTT reporter

    Great ! It works now ;)

    I guess I was missing this condition %{00041} != null that would prevent it to work due to the shared workflow for tasks and sub-tasks.

    Thanks again for all your time and your efficiency as always!

    Have a good one.

    John

  19. Log in to comment