Hi Team,
we trying to Set the date field is to be set based on the custom field value, like
we need to set a custom field Start Date, based on Processing Period dropdown field value.
The Start Date field is not in the screens, we want to set this field backend and use later for other automation, so we would like to achieve from JMWE.
The requirement should be like below
if Processing Period = 1Q2024, set Start Date = 1 Jan 2024
if Processing Period = 2Q2024, set Start Date = 1 Apr 2024
and so on…
tried the below script on both Event based postfuctions and postfuctions in workflow.
{% set ProcessingPeriod = issue.fields.customfield_25254 %}
{% set StartDate = issue.fields.customfield_23975 %}
{% if ProcessingPeriod == "1Q2024" %}
{% set date = "Jan 01, 2024" %}
{% set _ = StartDate.setDate(date) %}
{% elif ProcessingPeriod == "2Q2024" %}
{% set date = "Apr 01, 2024" %}
{% set _ = StartDate.setDate(date) %}
{% endif %}
After setting the processing period on transioton there nothing is triggering to set for Target date, no error is displayed.
Can any one please help me on resolving from it.
Thanks,
Beginner,
Hi @Learner AJ
there are a couple of reasons why your script doesn't work:
Try this script:
{% switch issue.fields.customfield_25254.value %}
{% case "1Q2024" %}
2024-01-01
{% case "2Q2024" %}
2024-04-01
{% endswitch %}
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.