Copying Field Value from Story To Bug

Issue #832 resolved
Rjve Nautiyal created an issue

Hi Fidel,

Hope you are doing good.

We have a requirement where in there is a field called "Portfolio" which is a cascading fields at three levels for issue type - Story.

While creating the Story, user will select the field values for Portfolio and I wanted to copy those values to issue type -Bug which have a field Portfolio (This is a text field read only)

The bug is not linked to story at all and both are individual entity, can you please confirm if it is possible to achieve through JIRA workflow toolbox.

I am using JIRA 7.1.4 (Server Version)

Thanks & Regards, Rajeev Nautiyal

Comments (25)

  1. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    I have 2 questions:

    1. JIRA native Cascading Select fields only have 2 levels. Which type of custom field are you using? Is it provided by a third-party add-on?

    2. Which relation is there between Story and Bug? How can I select the Bug issue at the moment of Story creation?

  2. Rjve Nautiyal reporter

    Hi Fidel,

    1. JIRA native Cascading Select fields only have 2 levels. Which type of custom field are you using? Is it provided by a third-party add-on? The Plugin used is "Multi-Level Cascading Select" which can have unlimited cascading levels by Sourcesense vendor

    2. Which relation is there between Story and Bug? How can I select the Bug issue at the moment of Story creation? At initial I thought of not keeping the relation but since it cannot be achived without relation. I thought of linking it with the name "Bug to CR"

    Thanks & Regards, Rajeev Nautiyal

  3. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    You can do it using "Read fields from linked issues or subtask" post-function in your Bug's workflow.

    Configuration to be used:

    • Target field: Portfolio (read-only field)
    • Source value: Portfolio (multi-level cascading field)
    • Issue link types: select the issue link type from the point of view of the Bug.

    Please, let me know if you have any doubt with the configuration.

  4. Rjve Nautiyal reporter

    Hi Fidel,

    Many thanks for your quick help and support. I have a query is it possible to copy multi-level cascading field values to Single list choice values. For example- Multi-level cascading field have values 1-2-3 So I want to copy value one in other field whose customer field type is single list choice

    Thanks & Regards, Rajeev Nautiyal

  5. Fidel Castro Armario repo owner

    Yes, you can. In order to read the first level of a Multi-Level Cascading Select field, you have to use the following syntax: %{nnnnn.0}, where nnnnn is field code for Multi-Level Cascading Select field.

  6. Rjve Nautiyal reporter

    Hi Fidel,

    Will it be the same post-function in bug workflow that is "Read fields from linked issues or subtask"

    Thanks & Regards, Rajeev Nautiyal

  7. Fidel Castro Armario repo owner

    You can do it using "Read fields from linked issues or subtask" post-function in your Bug's workflow.

    Configuration to be used:

    • Target field: you Select List custom field.
    • Source value (parsed text in basic mode): %{nnnnn.0}
    • Issue link types: select the issue link type from the point of view of the Bug.

    replacing nnnnn with field code for Multi-Level Cascading Select field.

  8. Rjve Nautiyal reporter

    Hi Fidel,

    I tried it but the values are not getting populated. Instead of Bug I am using Dev Task. and CR is the main issue type which will get linked to Dev task.

    Attached is the screenshot for reference.

    Thanks & Regards, Rajeev Nautiyal

  9. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    Try replacing Portfolio_Single_Choice with New comment as target field.

    With this modification a comment will be automatically created in the linked issue with the value of first level of field Portfolio_Client_LOB in current issue.

    Please, try this modification and let me know whether the expected result happens.

  10. Rjve Nautiyal reporter

    Hi Fidel,

    I tried replacing with new comment as target field but still the values are not getting copied. Attached is the screenshot for reference

    Also, if I want the multi-level cascading select field values to be selected within the issue for "Select List Custom Field" is it possible.

    Thanks & Regards, Rajeev Nautiyal

  11. Rjve Nautiyal reporter

    Hi Fidel,

    I have added the post function at last and it worked.

    But my requirement is the value should get copied to "Select List" custom field instead of "New Comment".

    Thanks & Regards, Rajeev Nautiyal

  12. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    You should do the following:

    1. Move post-function "Creates the issue originally" to first position in execution order.
    2. Select List target field should contain options with exactly the same name of each possible option in the first level of the Multi Cascading Select List.
  13. Fidel Castro Armario repo owner

    Is "Portfolio_Single_Choice" an ordinary JIRA Select List custom field, or is it provided by a third-party add-on?

    Did you ensured that Portfolio_Single_Choice contains options with the same name as those at first level of Multi Cascading Select List field?

  14. Rjve Nautiyal reporter

    Hi Fidel,

    I tried it worked, many thanks for it.

    But when the values of multi-cascading select list is changing in the story the same is not getting reflecting in Dev Task- Portfolio_Single_Choice field.

    Thanks & REgards, Rajeev Nautiyal

  15. Rjve Nautiyal reporter

    Hi Fidel,

    Any luck on the above comments, my apologies for follow-up.

    Thanks & Regards, Rajeev Nautiyal

  16. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    Post-function for setting Portfolio_Single_Choice field will only be executed when the transition where it's inserted is executed.

    A solution is to allow field Portfolio_Client_LOB (i.e., the Multi-Level Cascading field) to be edited only through a screen in a transition. To do it you should implement the following steps in the workflow of the issue that contains field Portfolio_Client_LOB:

    1. Remove Portfolio_Client_LOB from EDIT screen.
    2. Create an screen called "Portfolio_Client_LOB Edition", and add field Portfolio_Client_LOB to it.
    3. Create a global reflexive transition called "Edit Portfolio_Client_LOB", and associate screen "Portfolio_Client_LOB Edition" to it. Global transitions are available from any status in the workflow, and reflexive transitions keep the issue in the same status. The following screenshot shows how to create one of these transitions: global-reflexive-transition.png
    4. Insert post-function "Write field on linked issues or subtasks" in transition "Edit Portfolio_Client_LOB", in order to set field Portfolio_Single_Choice with the first level of Portfolio_Client_LOB with a configuration similar to la described in a previous post.
  17. Rjve Nautiyal reporter

    Hi Fidel,

    I have done the necessary changes as per the above steps, but the values are not getting populated in dev task. I have attached the screenshot for reference. Whenever the values of the story - Portfolio_Client_LOB gets changed, the same should reflect automatically in Dev task.

    Thanks & Regards, Rajeev Nautiyal

  18. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    With the proposed solution you will have to edit field "Edit Portfolio_Client_LOB" by executing transition "Edit Portfolio_Client_LOB". Since you have removed Portfolio_Client_LOB field from EDIT screen, you will not be able to edit it in the ordinary method.

    Are you editing the Portfolio_Client_LOB field as I have described above?

  19. Rjve Nautiyal reporter

    Hi Fidel,

    Yes, I am editing the Portifolio_Client_LOB. When I have created a transition as per the described post we get a dialogue box in view screen and then click on it to edit.

    The current requirement is I should not touch that dialogue box and the field should get auto populate once the story field gets changed.

    Thanks & Regards, Rajeev Nautiyal

  20. Fidel Castro Armario repo owner

    Hi @rjvenautiyal,

    If you have followed the instructions I have given to you, it should be working.

    I would need a screen-share through Skype in order to see the failure in direct, and maybe I could find where is the problem.

    Another possible solution is to use a "Calculated Text Field" for implementing Portfolio_Single_Choice field. To do it you should use the following configuration:

    Captura de pantalla 2017-10-17 a las 10.15.01.png

    Text expression is:

    first(fieldValue(%{nnnnn.0}, linkedIssues("CR/Project To Dev Task, Dev Task To CR/Project"))) 
    

    replacing nnnnn with field code for Portfolio_Client_LOB custom field.

    With this solution you don't need to use any reflexive transition, and can keep field Portfolio_Client_LOB in EDIT screen, and maintain the normal way of field edition in JIRA.

  21. Rjve Nautiyal reporter

    Hi Fidel,

    The problem with "Calculated Text Field" is we cannot group the fields to extract the dashboard, so I am not preferring to go with it.

    I will share the detailed step to step document with screenshot to you as screen-sharing is not possible due to security reasons.

    Thanks & Regards, Rajeev Nautiyal

  22. Rjve Nautiyal reporter

    Hi Fidel,

    Apologies for delay in response, please proceed with the closure of the ticket.

    Thanks & Regards, Rajeev Nautiyal

  23. Log in to comment