Set Field conditional on Checkbox Values

Issue #710 resolved
NCATS LAB created an issue

JIRA Software 7.4.1, JWT 2.2.39

I have a custom field checkbox that can have more than one value. Depending on the checkboxes, I need to update the Description field. I have created Multi-line text boxes with the default value set to the text for each selection. I am copying the value to ephemeral, then using that value to set the Description depending on the selection in the checkbox. Example: Checkbox options, 1, 2, 3 Option 1 will result in Text A being written to description. Option 2 will result in Text B being written to description. Option 3 will result in Text C being written to description. If Option 1 and 2 are chosen, I want A and B written. If 1And/OR 2 AND 3 are chosen, I only want A and/or B written, and NOT C. Basically, I only want C if 3 is the ONLY selection.

Comments (10)

  1. Fidel Castro Armario repo owner

    Hi @NCATS_Lab,

    Do you want Description field to be overwritten with the calculated text you have described, or do you prefer the calculated text to be appended to the original content of the Description field?

    Can you, please, attach a screenshot with the post-function's tab of your attempt to implement the described functionality?

  2. NCATS LAB reporter

    I would like Description to follow the calculated text, and that seems to work, but I can't seem to figure out how to set the conditional arguments.

  3. Fidel Castro Armario repo owner

    Is "NCATS Department" the checkbox field?

    Which are the exact names of the options of checkbox field?

  4. NCATS LAB reporter

    I am close, but an additional issue I have found is that I can't get the strings to create page breaks correctly. Selection_030.pngSelection_031.pngSelection_032.png First image is the formula, second is how it shows in the Postfunction tab, and third is the actual result in the description field of the created issue.

  5. NCATS LAB reporter

    Fidel,

    I was able to find a resolution. I simply made the default values of my custom fields begin with an empty line, that way, it would render correctly after running the Post function. Additionally, I found this resolved my conditional issues:Selection_033.png Thank you for your quick resonse

  6. Fidel Castro Armario repo owner

    Hi @NCATS_Lab,

    You can add page breaks using prefix a in your setting rules. This prefix forces to evaluate the value part of setting rules in advanced parsing mode. Then you can use \\n for inserting line breaks in the string expression at the value part.

    Example:

    a((.*CyHy/Dev/RVA.*)(.*Lab.*))%{00061} + %{00062} + "\\n"
    
  7. NCATS LAB reporter

    That is helpful, thank you.

    I also would like to create a set of subtasks off this issue, too. I keep getting, "We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file."

    Should I start a new ticket for this?

  8. Fidel Castro Armario repo owner

    Please, create a new issue and attach your server's log file.

    Also attach to the new issue a screenshot of the validation's tab of your Create Issue transition.

  9. Log in to comment