Read fields from linked issues fails to read on create transition

Issue #324 resolved
Charles Szmagara created an issue

Hi,

I cannot get to read fields from a linked issue on create transition. Here's what I currently have: Value of field Summary in linked issues or subtasks will be copied to field Change Details in current issue, filtering issues by: Inward issue link types: is owned by.
Outward issue link types: none Subtasks won't be read. Sibling subtasks won't be read. Issue types: Generic Delivery.
Statuses: Open. Linked issues or subtasks may belong to any project. This feature will be run as user in field Current user.

Generic Delivery issuetype on create transition, creates Configuration Request issuetype with a link in between the two tickets. The above configuration is taken from a post function from Configuration Request worfkflow (create transition).

Generic Delivery (on create) -> create a linked issue Configuration Request (link: is owned by/contains) Configuration Request (on create) -> read fields from a linked issue

This scenario fails, but works if I create a new transition from Open to Open state for Configuration Request workflow. It seems there is a problem reading fields on create transition.

Please note that I am running this post function after issue has been created.

Can you please help me find a way to read fields on create transition from linked issues please?

Comments (32)

  1. Fidel Castro Armario repo owner

    Can you please attach a screenshot showing post-function's tab of "Create Issue" transition? I would like to see all the post-functions you are executing.

    Which version of JIRA are you using?

  2. Fidel Castro Armario repo owner

    If you create manually "Configuration Request" issue, and link it in create issue transition to a "Generic Delivery" in "Open" status, it will read the fields correctly. You can do it and confirm.

    I think the problem is in the way the plugin you are using to create the issue works. It creates the issue first, and then creates the issue links. At the moment of issue creation there isn't any linked issues, and for that reason nothing is read.

    You can use the following solution:

    1) Create a reflexive transition called "Read linked issues" in initial status (usually "Open") of Configuration Request's workflow. Reflexive transitions have same origin and destination status. In this case the transition will be like "Open -> Open".

    2) Add "Transition is triggered by JIRA Workflow Toolbox post-function" condition to "Read linked issues" transition. This way we are hiding the transition to JIRA users, leaving it available only to post-functions.

    3) Add "Read fields from linked issues or subtask" post-function to "Read linked issues" transition with the configuration you are currently using in "Create Issue" transition.

    4) Remove "Read fields from linked issues or subtask" post-function from "Create Issue" transition.

    5) Add "Copy a parsed text to a field" post-function to "Create Issue" transition of Configuration Request's workflow with the following configuration:

    • Target field: Execute transition (delayed execution)
    • Parsing mode: basic
    • Text to be parsed: Read linked issues

    Please, let me know whether it solves your problem.

  3. Charles Szmagara reporter

    It is working! Thank you Fidel. You are truly a Jira Magician :) As to the add-on which causes the issue when creating issues, do you happen to know which add-ons are "compatible" with you your add-on or if you plan to introduce a post-function "create issue" to JIRA Workflow Toolbox?

  4. Fidel Castro Armario repo owner

    Thank Charles. Yes, I'm planning to add a post-function for creating issues in a few months.

  5. Charles Szmagara reporter
    • changed status to open

    Hi This issue is back. Bizarrely, when I run the manual post function (Read linked issues) it works (reads linked issues fields), but when it's ran from within create transition it doesn't read at all. There is nothing is the logs. I have just wasted 3hrs troubleshooting... can you please help me?

  6. Fidel Castro Armario repo owner

    Charles, can you please attach screenshots of condition, validation and post-function tabs of "Read linked issues", and only post-function tab of "Create Issue" transition?

  7. Fidel Castro Armario repo owner

    Please, try removing post-function number 6 from "Read linked issues" transition. You shouldn't set a field twice in a post-function. JIRA doesn't manage it well.

    In addition, I don't find a reason to have post-function 6, since post-function 1 is reading values included by post-function 6.

  8. Charles Szmagara reporter

    Same effect, on create, it doesn't run the "read linked issues" transition. When I run it manually, it works. I can see that the transition count is increasing, but only when I run that transition manually.

  9. Fidel Castro Armario repo owner

    Please, edit "Copy a parsed text to a field" post-function in "Create Issue" transition and replace "Text to be parsed" parameter with the following value:

    Read linked issues : {delay=3000}
    

    Now we are forcing the transition execution to be done 3 seconds after issue creation. Maybe, we are trying to read linked issues before issue links are actually created.

  10. Fidel Castro Armario repo owner

    Please, do the following:

    1. Remove the 3000 ms delay.
    2. Set logging level for package com.fca.jira.plugins.workflowToolbox to DEBUG. You can do it at Administration > Logging and profiling > Configure logging level for another package
    3. Reproduce the problem and share your log file with me. You can send it to support@workflowarts.com.
  11. Charles Szmagara reporter

    Please note that: SDM-91 creates a linked issue NET-170. NET-170 creates a linked sub-task NET-171. SDM-91 -> owns - is owned by <- NET-170 NET-170 -> is blocked by - blocks <- NET-171

    I am trying to read fields from SDM-91 when NET-170 is being created.

  12. Fidel Castro Armario repo owner

    Charles, please, try reinstalling the plugin, i.e., uninstall it and then install it again.

  13. Charles Szmagara reporter

    It's suddenly working now. What happened? The usual switch it off/on solution? lol

  14. Fidel Castro Armario repo owner

    The problems seems to be related with a thread created by the plugin that has become unstable. This is the first time it happens. I have to investigate the possible cause. Please, notify it in case it happens again. Thanks.

  15. Tom Vercellotti

    Hi Fidel - we are running into the deadlocked state with the plugin again. Our subtasks are not able to change the status of a parent issue automatically - instead the parent remains in their original state. This time we don't have a way to resolve the issue as we did last time when we installed a new version of the plugin. Please advise if we should uninstall and reinstall the plugin. What other information can we provide you to resolve this item ASAP?

  16. Fidel Castro Armario repo owner

    Hi Tom, I'm sorry that the issue is still unresolved and becoming critical for you. Now, this issue has top priority.

    Please try simply to disable and then enable the plugin. Tell me if this workaround solves, at least temporarily, the problem.

    After, that please, share your server's log file with me. You can send it to support@workflowarts.com.

  17. Fidel Castro Armario repo owner

    Hi Tom, I have found a possible cause of the problem but I'm not 100% sure, since I haven't succeeded at reproducing the problem.

    I have implemented the solution in version 2.2.16_beta_4.

  18. Tom Vercellotti

    We have upgraded to 2.2.17 and the issue seems to be occurring again. Also, after the plugin stopped auto updating the status of the parent records, we cant seem to reset the plugin to begin working again. We disabled / renabled and also did an uninstall / reinstall with no luck. Can you advise?

  19. Fidel Castro Armario repo owner

    I don't know the cause of your problem, but reinstalling the plugin should work if it's some kind of deadlock in a thread of the plugin. Please try the following:

    1. Reinstall version 2.2.17.
    2. If the problem remains reinstall version 2.2.15.
  20. Fidel Castro Armario repo owner

    Please, share with me you server log file (version 2.2.17 has enhanced output to the log file), and also the XML export of the workflows implied in the problem.

  21. Fidel Castro Armario repo owner

    Tom, I think I have found definitely the cause of the bug, and fixed it in version 2.2.18_beta_3.

    You can install this version in production environment since it only differs from 2.2.17 in this bug fix.

  22. Log in to comment