How is it possible to build in an addtional condition for an event based "issue-field-value-changed"+"set-issue-field"-post function?
E.g.:
if the value of a field A is between 0 and 100, then set the value for filed B = 1,
if the value of a field A is between 100 and 200, then set the value for filed B = 2,
and so on
you don't need a condition for that - what you want is to use the Set Issue Fields post-function in the event-based action to set field B to a value calculated based on field A, using a Nunjucks expression. For example:
{% if issue.fields["A"] <= 100 %}
1
{% elif issue.fields["A"] <= 200 %}
2
{% else %}
3
{% endif %}
Hi David,
Thank you very much
Could you please support me with the format?
I would like to calculate the value for the field "Score" based on the formula below.
The dominator in the formula should become the values 1, 2, 3, 5 or 8 depending on the value for the field "Σ Original Estimate".
{{ (issue.fields["Business Value"] + issue.fields["Time Criticality"] + issue.fields["Risk Reduction"]) / ({% if issue.fields["Σ Original Estimate"] < 14400 %}
1
{% elif issue.fields["Σ Original Estimate"] < 28800 %}
2
{% elif issue.fields["Σ Original Estimate"] < 43200 %}
3
{% elif issue.fields["Σ Original Estimate"] < 72000 %}
4
{% elif issue.fields["Σ Original Estimate"] < 115200 %}
5
{% else %}
8
{% endif %}) }}
Many thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dmitry Kharishman ,
try this:
{% if issue.fields["Σ Original Estimate"] < 14400 %}
{% set denom = 1 %}
{% elif issue.fields["Σ Original Estimate"] < 28800 %}
{% set denom = 2 %}
{% elif issue.fields["Σ Original Estimate"] < 43200 %}
{% set denom = 3 %}
{% elif issue.fields["Σ Original Estimate"] < 72000 %}
{% set denom = 4 %}
{% elif issue.fields["Σ Original Estimate"] < 115200 %}
{% set denom = 5 %}
{% else %}
{% set denom = 8 %}
{% endif %}
{{ (issue.fields["Business Value"] + issue.fields["Time Criticality"] + issue.fields["Risk Reduction"]) / denom }}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.