Copying Field Value from Story To Bug

Issue #832 new
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 (21)

  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. 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

  4. 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.

  5. 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

  6. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    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.

  7. 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

  8. 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

  9. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    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.
  10. 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?

  11. 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

  12. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    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.
  13. 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

  14. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    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?

  15. 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

  16. Log in to comment