Free Text Multi-line Combining 3 Different Fields (Select List, Multiple Choice, Select List)

Issue #726 resolved
Rjve Nautiyal
created an issue

Hi Fidel,

Could you please confirm if the below requirement is achievable with the help of jira workflow toolbox-

Step-1 Selection Control (Select List)- Value -1 Once the users select the "selection control" field as "Value-1" the other field should pop-up called "Controls". The field "Controls" is (Multiple Choice type) and the users select- Control-1 and Control-2. Based on Control-1 and Control-2 values a third field called "Rating" (Select List) should pop-up and the users should be able to rate each control-1 and control-2 (with the values from 1 to 5).

Then in same issue Step-2- user again select the Selection Control (Select List)- Value -2 Once the users select the "selection control" field as "Value-2" the other field should pop-up called "Controls". The field "Controls" is (Multiple Choice type) and the users select- Control-3 and Control-4. Based on Control-3 and Control-4 values a third field called "Rating" (Select List) should pop-up and the users should be able to rate each control-3 and control-4 (with the values from 1 to 5 for the field rating).

Once the above steps are ready, the field values should go in free text multi-line. I am attaching the snapshot for more details.

I am using JIRA server 7.1.4.

Thanks & Regards, Rajeev Nautiyal

Comments (31)

  1. Rjve Nautiyal reporter

    Hi Fidel, Many thanks for quick response.

    Could you please confirm the expression in a Text Multi-line field which can help me to put field values one below to other. Please see below for instance- Selection Control-Value-1 Controls- Control-1

    Thanks & Regards, Rajeev Nautiyal

  2. Rjve Nautiyal reporter

    Hi Fidel,

    Many thanks for quick response and it work like charm. I am bit stuck with below scenario-

    Currently I am using copy a the parsed text to field, in this I am not able to separate each values under multi-choices field type separately. Whatever value I am selecting in multi-choice values while creating the issues I am getting all the entire values together in inside text line field with comma. What I am looking is I select- Choice-1, Choice-2 and Choice-3 under Multi-Choice field type under text multi- line it should come as Header of Multi-choice- Choice-1 - Choice-2 - Choice-3 You can refer the attachment with the name-"Attach-1". Preventive Measure is the multi-text field and Multiple-Choices-Copy-Parsed is the field of choice.

    Also would you please share the link or a doc which can help me to understand the expression in more details.

    Thanks & Regards, Rajeev Nautiyal

  3. Rjve Nautiyal reporter

    Hi Fidel,

    Please refer the attachment-1, Multiple Choice is the field name and the users select multi-values in it. The Multi-values are getting copied to the field called "Preventive Measures" - 2nd Line in one text. The Multi-choice value should come one below the other.

    I have also attached - Copy a Parsed text to a field for more details.

    Thanks & Regards, Rajeev Nautiyal

  4. Fidel Castro Armario repo owner

    It's better to use the following string expression:

    "Selection Control: " + toString(textOnStringList(toStringList(%{15801}), "\\n - " + ^%), "") +
    "\\nMultiple Choices: " + toString(textOnStringList(toStringList(%{15804}), "\\n - " + ^%), "")
    
  5. Rjve Nautiyal reporter

    Hi Fidel,

    Many thanks for quick response.

    It worked like charm. One quick query- I wanted to extract the multi-cascading field history with header to other text. I tried in the wiki but would not find the expression to extract history

    Thanks & Regards, Rajeev Nautiyal

  6. Rjve Nautiyal reporter

    Hi Fidel,

    The above string expression does not seem to work, I used the expression under "Copy a Parsed Text" function and targeted field is "Multi-line" and the source field is cascading fields.

    I have attached the error screenshot for reference

    Thanks & Regards, Rajeev Nautiyal

  7. Fidel Castro Armario repo owner

    Function fieldHistory() doesn't include field's current value, and since you are executing the post-function in Create Issue transition, it's expected to return an empty string (i.e., nothing).

    If you want to include current value, you can use the following text expression:

    "Field History: " + toString(textOnStringList(fieldHistory(%{15801}) APPEND [%{15801}], "\\n - " + ^%), "")
    

    BTW, I recommend to insert the post-function just after "Creates the issue originally", i.e., in 2nd position of execution order.

  8. Rjve Nautiyal reporter

    Hi Fidel,

    As per the attached screenshot, When I am viewing Multi-Level Cascading field history all the values are getting merged and there is some heading called "Level 1" and "Level 2" and "Level 3" also heading with numbers "24556", "24459", "24462".

    What I am looking is as below-

    Selection Control- Values X Multiple Control- Values 1 Rating- Values 2

    Then once I update the values should be added again to it-

    Selection Control- Values X Multiple Control- Values 1 Rating- Values 2

    Selection Control- Values Y Multiple Control- Values 2 Rating- Values 3

    Thanks & Regards, Rajeev Nautiyal

  9. Fidel Castro Armario repo owner

    Try this string expression:

    "Field History: " + replaceAll(toString(textOnStringList(fieldHistory(%{15801}) APPEND [%{15801}], "\\n - " + ^%), ""), "\\s*((\\(\\d{5}\\))|(Level .:))\\s*", "")
    
  10. Rjve Nautiyal reporter

    Hi Fidel,

    Many thanks for quick response and it is working perfectly.

    I have one last query- In above cascading field history at third level I wanted to insert a heading and then the value is it possible?

    Thanks & Regards, Rajeev Nautiyal

  11. Fidel Castro Armario repo owner

    Try the following text expression:

    "Field History: " + replaceAll(replaceAll(toString(textOnStringList(fieldHistory(%{15801}) APPEND [%{15801}], "\\n - " + ^%), ""), "Level 3:", "my heading"), "\\s*((\\(\\d{5}\\))|(Level .:))\\s*", "")
    

    replacing my heading with the heading you want to use add for Level 3 values.

  12. Rjve Nautiyal reporter
    • changed status to open

    Hi Fidel,

    I have one quick query on this ticket, when we extract history details of cascading fields i am getting the values of the field next to each other- Select list value, value-2,Rating-1

    Can i get the details as below- Select List Value-2 Rating-1

    I am almost done but stuck with only this issue

    Thanks & Regards, Rajeev Nautiyal

  13. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    I made a mistake in my previous expression, since I was trying to present the values one below the other. Try this expression:

    "Field History: " + replaceAll(replaceAll(toString(textOnStringList(fieldHistory(%{15801}) APPEND [%{15801}], "\n - " + ^%), ""), "Level 3:", "my heading"), "\\s*((\\(\\d{5}\\))|(Level .:))\\s*", "")
    

    I have simply replaced \\n with \n.

  14. Rjve Nautiyal reporter

    Hi Fidel,

    My apologies If I was not clear.

    The value of the fields are coming next to each other- If you refer the attachment the one highlighted in Black Box.

    My expectation is the value of the fields should come one below the other. If you refer the attachment the one highlighted in Red Box is what I am looking for. One field have 3 cascading values and should come one below the other.

    Thanks & Regards, Rajeev Nautiyal

  15. Rjve Nautiyal reporter

    Hi Fidel,

    A small change in my requirement above for multi-cascading fields.

    Currently I am looking to extract second and third level of history field to a text field instead of extracting the entire field to the text field.

    I am ok if the field value come to each other, I just got an approval for the same.

    Thanks & Regards, Rajeev Nautiyal

  16. Fidel Castro Armario repo owner

    Hi @Rjve Nautiyal,

    Try this text expression:

    "Field History: " + toString(textOnStringList(fieldHistory(%{15801}), replaceAll(replaceAll(^%, "(Level 1: [^,]+)|(, Level \\d+: )", ""), " \\(\\d+\\)", "\n")), "\n") + "\n\n" + %{15801.1} + "\n" + %{15801.2}
    
  17. Log in to comment