How to set rules on customfields in Jira ?

Saloua_Toumi December 24, 2018

Hello guys, 

I have a pretty confusing usercase, and it doesn't help being a Jira beginner :(. It would be much appreciated if I could get some of your helpful ideas.

 

I have a custom field "A" with ( X, Y, Z, W, U) as options.

And I have two date picker fields "date1" and "date2", I want to set date1 if rules apply, as follow: 

If A= X or Y  then date1=currentdate + 1 month

if A= Z  then date1=currentdate + 2 months

if A= W or U  then date1=currentdate + 3 months

After that: I want to compare date1 and date2. 

if date2 > date1 then date1 = date2, else, we keep date1 from previous result. 

 

I hope this is clear, I can be more specific if needed. 

We are using Jira 7.6, with Automation for Jira plugin (3.14.12). Plus Jira workflow toolbox.

 

Thank you in advance

3 answers

1 accepted

0 votes
Answer accepted
Nick Menere
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 1, 2019

Hi @Saloua_Toumi,

 

To this you need to create a rule that looks like the following:

whole_rule.png

 

First this rule uses If/Else branch to check the value of Field A and then set the Date 1 field appropriately.

It then refetches the issue data and performs the second check and updates Date 1 if needed.

 

The if/else branches should look like:

Screen Shot 2019-01-02 at 9.19.33 am.png

 

And the Edit would look like:

Screen Shot 2019-01-02 at 9.19.41 am.png

 

You then need to refetch the issue and compare it:

Screen Shot 2019-01-02 at 9.19.52 am.png

You can then copy Date 2:

Screen Shot 2019-01-02 at 9.26.15 am.png

 

Hope that is what you were after.

 

Cheers,

Nick

Saloua_Toumi January 12, 2019

Hello @Nick Menere

Thank you very much for your answer, it's very clear and detailed, really appreciate the help.

I am trying to test it on preprod but haven't succeeded yet, due to some technical issues on the platform, and the JQL for my custom field. I'll keep you in touch once it's resolved.

I'm going to accept your answer, but still open to new propositions.

Cheers,

Saloua

0 votes
Saloua_Toumi December 26, 2018

Hello Grigory,

Thanks for the answer, I don't think I'm allowed to download new plugins :/. 

I'm hopping to find someway to do this using Automation for Jira plugin. Or any idea really.

0 votes
Grigory Salnikov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 24, 2018

Hi, @Saloua_Toumi!

In our environment, I had a similar task which was to convert an employee's birthday to the "Current Year Birthday" field so that it would be displayed on the calendar. I managed to accomplish this task with the help of the following free plug-in:

Jira Misc Custom Fields

There's a Calculated Date field there and where we can calculate the field's value based on the other fields' values.

Suggest an answer

Log in or Sign up to answer