Select List (cascading) Fields - Inserting Text into both Fields

Issue #308 resolved
Joseph Pursel created an issue

I am designing a workflow that adds values to multiple Select List (cascading) custom fields during transitions through the workflow. The initial values of each of the two fields is "NONE", so they will not show on the view screen until they are populated during this transition. The workflow transition is shown below.

Workflow Sample.png

On transition from CRequest to Supporting Documents, have custom select list (cascading) fields appear on the transition screen.

If the field is a required field, I want to change the value for {nnnnn.0} to Required and value for {nnnnn.1} to Not Uploaded.

I also want to be sure that the field is filled with a valid entry for all remaining transitions before it is can be transitioned to the next status.

If the field is not required, I want to change the value for {nnnnn.0} to Not Required and value for {nnnnn.1} to Not Needed.

I also want to be sure that the field is filled with a valid entry for all remaining transitions before it is can be transitioned to the next status.

My approach is to have all fields initially be Optional in the Field Configuration but required fields for the issue will become required (set by the validator) for the rest of the workflow.

This way I only need 1 View screen as the fields will not be shown on the view screen if they are null (as they are optional). Once populated with a value, they will remain on the View screen (and become required). I am trying to not have to switch screens after these fields are filled.

Please help me with a solution to this problem.

Comments (17)

  1. Fidel Castro Armario repo owner

    Hi Joseph,

    There are things in your description I don't understand:

    If the cascading select fields (required and non-required) appear in transition screen of "CRequest-to-Supporting Documents" transition, I suppose you expect the user to enter a value. Nevertheless, you say that you want level 0 to be set to "Required", and level 1 set to "Not Needed". It's strange, but according to your description It seems that "Required" and "Not Needed" are options available in all your cascading select list, although expecting a certain value at each level, and having the fields in transition screen to ask the user entering a value don't make any sense to me.

    I think that it might be a good idea to have a videoconference with a screen-share tomorrow. I would like to talk with you a see your workflow in direct.

    We can use Skype (my Skype user is fidel100r) or any other service you can provide. I will be available from 8:00 UTC to 13:30 UTC, and may be later. Please, set a time for the videoconference as early as possible.

  2. Joseph Pursel reporter

    Hi Fidel,

    I added the remaining Post Functions and Validators to the transitions to validate the content of the Select List (cascading) fields as you showed me yesterday and they work!

    Now I need to add a Condition on the transition from Supporting Documents to CRequest Released to hide the transition button from the View screen until all Select List (cascading) fields have the correct content. In the past I used the JSU option of a field must have the value of "text evaluated"

    I would like to use a JWT condition evaluation so the transition button will only appear if all Required fields are .0 = Required and .1 = Uploaded to Comprizon.

    The Required fields are fine as they are coded as - Only if the following boolean expression is true: %{Section 508 Compliance Checklist.1} = "Uploaded to Comprizon"

    However I receive a Parsing Error for the Non Required Fields when coded as shown below. To show the transition button, the Non Required fields must be either (.0 = Not Required and the .1 = Not Needed) OR the (.0 = Added to list and the .1 = Uploaded to Comprizon) The parsing error is below.

    Only if the following boolean expression is true: (%{11797.0} = "Added to List" AND %{11979.1} = "Uploaded to Comprizon") OR (%{11797.0} = "Not Required" AND %{11797.1} = "Not Needed") :: PARSE ERROR : "%{11979.1}" is not a valid indexable field (Cascading, Multi-Cascading... ) identifier due to: "11979" doesn't correspond to an existing field code.*

    Please help me code this condition correctly.

    Thank you Joseph

  3. Fidel Castro Armario repo owner

    Joseph, the problem is that you are writing %{11979.1} in the second field code of the expression, while the correct field code is %{11797.1}

    The correct boolean expression is:

    %{11797.0} = "Added to List" AND %{11797.1} = "Uploaded to Comprizon" OR %{11797.0} = "Not Required" AND %{11797.1} = "Not Needed"
    
  4. Joseph Pursel reporter

    Thank you Fidel,

    I had the second field code incorrect. The Condition now shows as Only if the following boolean expression is true: (%{JOFOC/Sole Source.0} = "Added to List" AND %{JOFOC/Sole Source.1} = "Uploaded to Comprizon") OR (%{JOFOC/Sole Source.0} = "Not Required" AND %{JOFOC/Sole Source.1} = "Not Needed") which is correct.

  5. Joseph Pursel reporter

    Fidel,

    Once all fields are set in the CRequest Released status and the issue goes from status to status until it is done, I need to ensure the contents of the special fields have not changed. Two examples are below:

    Only if CRequest Number custom field hasn't changed. Message to show when validation fails: "The CRequest Number has been changed. Please enter the original CRequest Number and retry the transition.".

    Only if NOAALink Worksheet custom field hasn't changed. Message to show when validation fails: "The NOAALink Worksheet Field(s) have been changed. Please enter the original content in both cascading levels and retry the transition.".

    My question is, what is the validator comparing when it checks to see if the field content has changed, from when to when, or status to status, or during its time in the previous status? A follow-up question is If it needs to be re-entered (i.e. someone changed the content) will it fail the validation if corrected as the content was changed when it is re-transitioned?

    Please verify or provide the correct use of the "hasn't changed" comparison. If there is a better validator, please provide an example.

    Thank you in advance Joseph

  6. Fidel Castro Armario repo owner

    Joseph, I think that your solution is very strange, not very intuitive for the user, and very complex to implement, although it's somehow possible.

    I propose you an alternative solution, explained in 5 steps:

    1) Create a screen called "Documents" and add to it all the cascading select fields representing documents (required and non-required). I think that your cascading fields are representing documents.

    2) Create a global reflexive transition called "Update documents". This transition is available for all the statuses in your workflow, unless we restrict visibility with a condition (we will do it). This issue also doesn't change issue status. In issue 272 a screenshot shows how to create this kind of transitions.

    3) Associate "Documents" screen to "Update documents" transition.

    4) Add "Boolean condition with math, date-time or text-string terms" condition with a boolean expression like this:

    %{00016} in ["CRequest", "Suporting Documents", "status X", "status Y", "CRequest Released"]
    

    Note that %{00016} is field code for "Issue status".

    The statuses in the boolean expression are the only ones where "Update documents" transition will be visible.

    5) Remove all the cascading select fields representing documents (required and non-required) from Edit screen (not from View screen). This way we ensure that the only way to update those fields is through "Update documents" transition.

  7. Joseph Pursel reporter

    Fidel,

    I have completed items 1-3. When I try to add a condition to the Global Reflexive transition, I receive a 404 error that says I have found a dead link.

    Also, If I understand item 5, the select list documents fields will only be shown on the Edit screen. My user wants all of the select list documents fields to show at all times and in every status from Supporting Documents through the Done status. This is why I was testing the fields on transition to see if the content had changed.

    Please let me know how to get past the 404 dead link error and please provide an alternative to item 5.

    Thank you, Joseph

  8. Fidel Castro Armario repo owner

    There is a bug in some versions of JIRA that causes that problem. Once you have added the global reflexive transition, you should edit your workflow in TEXT mode, this way you can add the condition without problems.

    I'm assuming that you have separate screens for VIEW and for EDIT operation. I'm asking you to remove it from the EDIT screen, not from VIEW screen, this way your users will always see the fields in all the statuses.

    If you are sharing the same screen for VIEW and EDIT operations, you can make a copy of your current screen, and remove all the cascading select fields, and associate it with EDIT operation.

  9. Joseph Pursel reporter

    Fidel,

    All is working fine. I have tested my workflow conditions, validators and post functions. I reviewed the fields and process with the user. I have to make one change - For fields that are Not Required, I need to make them None and None so they are hidden during the rest of the process.

    Thank you, Joseph

  10. Fidel Castro Armario repo owner

    Good news, Joseph.

    You can set your fields to none (i.e., null) using "Copy a parsed text to a field" post-function with the following configuration:

    • Target field: field to be set to none.
    • Parsing mode: basic
    • Text to be parsed: keep the field empty, in case it doesn't work try writing simply 'null' without quotes.
  11. Joseph Pursel reporter

    Fidel,

    Thank you for this solution. I do need to qualify the field content of the .0 option to be "Not Required" before I can set both select options to 'null'.

    Will the post function shown below work?

    The following text parsed in basic mode will be copied to Late Memo: %{Late Memo.0} = "Not Required" implies %{Late Memo.0} = "None" AND %{Late Memo.1} = "None" This feature will be run as user in field Current user.

    Thank you, Joseph

  12. Fidel Castro Armario repo owner

    Use the same configuration I explained you in my previous post, but now set parameter "Conditional execution" with the following boolean expression:

     %{nnnnn.0} = "Not Required"
    

    replacing nnnnn with the field code of target field.

  13. Joseph Pursel reporter

    Fidel,

    I changed the JOFOC/Sole Source field post function boolean condition to:

    The following text parsed in basic mode will be copied to JOFOC/Sole Source: %{JOFOC/Sole Source.0} = "Not Required" This feature will be run as user in field Current user. as you stated above.

    In my test case I changed the JOFOC/Sole Source fields to .0 "Added to List and .1 "Uploaded to Comprizon". The boolean condition post function replaced these field values with 'null' and 'null', but this is not what I want. The conditions and validators used in this transition prevent the transition unless the .1 = "Added to List" has the .2 = "Uploaded to Comprizon so the fields that are processed by the post function are correct.

    Please show me the correct post function boolean conditional expression and the expression to do the following:

    If .0 = "Not Required" Then .0 = 'null and .1 = 'null' If .0 = "Added to List" Then do not change the .0 and the .1.

    Thank you, Joseph

  14. Fidel Castro Armario repo owner

    Hi Joseph,

    I asked you to set parameter "Conditional execution", but it seems that you entered the boolean expression in parameter "Text to be parsed".

    Use the following configuration:

    • Target field: JOFOC/Sole Source
    • Parsing mode: basic
    • Text to be parsed: null
    • Conditional execution: %{nnnnn.0} = "Not Required"

    replacing nnnnn with field code for JOFOC/Sole Source custom field.

  15. Joseph Pursel reporter

    Fidel,

    Success!

    All workflow Conditions, Validators and Post Functions are correct and handle the options perfectly.

    Thank you, Joseph

  16. Log in to comment