Transition screen depending on filled field

Issue #201 resolved
FatimaM created an issue

Hi.Is it possible to attach screen to transition on condition:if field i.e Vendor Name is not filled then this screen on this transition will appear.But if it is filled then not

Comments (8)

  1. Fidel Castro Armario repo owner

    A way to do it is to use two parallel transitions, i.e., two transitions with same origin status, and with same destination status. You can call those transitions with similar names, but not the equal, since a status can't have two leaving transitions with the same name.

    One of these transitions will have associated the screen, while the other one will not have any screen associated.

    Now you only have two add conditions to both transitions in order to make visible the one with the screen when the field is not set, and the other one when the field is set. To do it you can use "Boolean condition with math, date-time or text-string terms" with boolean expressions like these:

    %{nnnnn} = null
    

    and

    %{nnnnn} != null
    

    replacing nnnnn with the corresponding field code in your JIRA instance.

  2. Fidel Castro Armario repo owner

    Sorry, I made a mistake. You should use the following boolean expressions:

    %{nnnnn} = null OR hasChanged(%{nnnnn})
    

    and

    %{nnnnn} != null OR hasChanged(%{nnnnn})
    
  3. FatimaM reporter

    %{nnnnn} = null OR hasChanged(%{nnnnn}) is it neccessary here hasChanged(%{nnnnn}) function?

  4. Fidel Castro Armario repo owner

    JIRA checks conditions twice in a transition:

    1. In order to determine whether the issue is going to be displayed or hidden to the user.
    2. Just before transition execution.

    In both occasions conditions should be satisfied. If you don't add the term hasChanged(%{nnnnn} to your boolean expression, condition %{nnnnn} = null won't be satisfied once you have given value to it transition screen, and transition execution will throw error "Action is invalid".

    I think that in your case you don't need term hasChanged(%{nnnnn}) in condition %{nnnnn} != null, unless you want to allow the user to unset field in transition screen. Anyway, it won't hurt.

  5. FatimaM reporter

    Thanks for reply.One advice pls.could we rename the transitions with the same name.You advice us to create the same transitions.But Jira does not allow to name it with the same names,is it possible for user to show these both transitions as the same.so he will not understand the difference and will not get the trick

  6. Fidel Castro Armario repo owner

    Sorry, you can't, at least using JIRA GUI. Perhaps, exporting the workflow as XML, editing it manually, and then importing it. I have never tried it.

  7. Log in to comment