Riskmanagement, multiply 2 fields and move to a status depending on result

Issue #394 resolved
DavidF created an issue

Hello Fidel,

I want to do the following with your Toolbox, but as i'm continuously failing, i wonder if it is possible at all. Maybe you have a hint (or two) for me?

In order to calculate the risk of something a client of mine is using two fields: 1. "probability" containing the values "low, medium, high" 2. "extent of damage" containing the values "low, medium, high"

Now the following is required: At first, the values should be translated into numbers: low =1. medium=2, high=3. Then the values should be multiplied with each other. If the product is <= 5 the issue should move in Status "A". If it is >5 then the Status should become "B".

Thank you in advance!

Kind regards, David

Comments (9)

  1. Fidel Castro Armario repo owner

    Hi David,

    I'm happy to help you, but I have a question for you.

    Do you want to implement this behavior at issue creation, i.e., do you want the issue to be automatically moved to "A" or "B" just after issue creation?

  2. DavidF Account Deactivated reporter

    Hi Fidel,

    thank you! The issue is already created. The assignee triggers the transition "evaluate risk" by clicking the button and then chooses the values for the two fields via a transition screen. Then the issue should move to either "A" or "B" given on the result.

  3. Fidel Castro Armario repo owner

    I explain step by step a configuration to implement the behavior you describe:

    I assume that:

    1. Transition "Evaluate Risk" is circular or reflexive, i.e., it has the same origin and destination status.
    2. The status containing "Evaluate Risk" transition also contains other 2 transitions with "A" and "B" as destination statuses.

    You should the following 3 post-functions to "Evaluate Risk" transition:

    1) Post-function "Set a field as a function of other fields" with the following configuration: conf-0.png

    2) Post-function "Set a field as a function of other fields" with the following configuration: Captura de pantalla 2016-08-16 a las 16.45.45.png

    Setting rules in both post-functions are:

    (Low)1
    (Medium)2
    (High)3
    

    Beware to write the names of the options in the setting rules respecting the case, i.e., write Low or low depending on the exact name of your options.

    3) Post-function "Copy a parsed text to a field" with the following configuration: Captura de pantalla 2016-08-16 a las 16.47.17.png

    Text to be parsed is:

    {00058} * {00059} > 5 ? "B" : "A"
    

    Note that:

    • A and B are the names of destination statuses
    • {00058} is code for numerical value of Ephemeral number 1 virtual field.
    • {00054} is code for numerical value of Ephemeral number 2 virtual field.

    Once configured, transition "Evaluate Risk" will look like this:

    Captura de pantalla 2016-08-16 a las 16.53.07.png

  4. DavidF Account Deactivated reporter

    Hi Fidel,

    thank you so much - this is just great. I have one last question though, if you please have the time:

    Is it possible in ONE Transition to enter the values for the two fields in a workflow-screen and then, referring to the outcome, either get to Status A or B?

  5. Fidel Castro Armario repo owner

    A transition can only have ONE target status, that's why we use the trick of using a reflexive transition, and then automatically trigger the transition that moves the issue to the selected status.

    I'm not sure if I have understood your question.

  6. DavidF Account Deactivated reporter

    Ok, I understand. But my challenge is: the user is supposed to choose the values for "probability" and "extent of damage" during a transition called "evaluate risk" by a workflow screen. It would be great if the destination status could be set automatically by the numbers the user chooses - in one transition.

    If that is not possible, I'll just add another Transition (with the workflow screen for choosing the values) and Status before evaluating the risk.

  7. Fidel Castro Armario repo owner

    The solution I gave to you does the transition to the selected status AUTOMATICALLY. Look carefully the configuration of the third post-function: target field is "Issue status (delayed writing)". When you write the name of a status on it, a suitable transition to that status is automatically triggered after a delay of 0.5 s after current transition has ended.

    The only requirement for this solution to work is that transitions exist from current status to the status whose names you write on "Issue status (delayed writing)", and that conditions and validations on those transitions are satisfied.

  8. Log in to comment