Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

set a field value based on created date

arige hamdan January 10, 2019

Hello,

I am looking to create a custom field that will be based on create date plus days. This field will be mostly used for counting time to close based on work hours days. if an issue is created between 8:00 to 18:00 the custom field should show created date plus 6 days and skipweekend[friday and saturday] but if it's created between 18:00 to 8:00 it should calculate created date plus 7 date skipweekend[friday and saturday]

Example would be:

1.Create date=1.1.19 8:00 + 6d = 9.1.19 18:00 [it should set always a specific hour 18:00 no matter when it was created and should skip weekend days [4/1 and 5/1]]

2.Created date = 1.1.19 19:00 +7d = 10.1.19 18:00 

 it should set the value of this addition in this date formate = 10.1.19 18:00 [date+time] and  a specific hour 18:00

 

Any suggestions would be greatly appreciated PLEASE.

Can you please send me the script that can do that?

Thanks

 

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 11, 2019

Hwllo Arige,

Check out the add-on Jira Misc Custom Fields that has a calculated date field option using a scripted groovy expression.

Then This previous post gives an example script that will calculate the date skipping weekends:

Regards,
Earl

arige hamdan January 16, 2019

Hi

thx for the help but unfortunately i did not found the script that can give what i need,

maybe you can help me and send to me a script that i can set in my postfunction's create transition so it could work like i wish and described above:

I am looking to create a custom field that will be based on created date plus days. This field will be mostly used for counting time to close based on work hours days. if an issue is created between 8:00 to 18:00 the sla should show created date plus 6 days but if it',s created between 18:00 to 8:00 it should calculate created date plus 7 date.

Example would be:

Create date=1.1.19 8:00 + 6d = 7.1.19 18:30 [it should set always a specific hour 18:30 no matter when it was created.

Created date = 1.1.19 19:00 +7d = 8.1.19 18:30

 it should set the value of this addition in days and  a specific hour 18:30 and also skip weekend [ friday and saturday]

 

thx again

best regard

Suggest an answer

Log in or Sign up to answer