Forums

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

"calculate" new date and time

Michelle Gaul
Contributor
March 13, 2019

Hello Community!

 

I am a very new user (admin) of Jira Service Desk (Cloud) for the small/medium company I work at.

 

currently i am in the trial phase of Calendar for Jira and i want to implement the add on to my Jira help desk.

In the settings page of the calendar you can set the start and the end date of events which shall be created. the start and end date fields have to be date or date + time fields (of course).

Unfortunately, i have an issue customizing the exact timing of the events to be created.

I work in a company, which has service desk agents, which will also travel to the customer, if personal assistance is required. The HR admin wants to look at the calendar and see which agent is currently available. As some agents have to travel to far-distanced customers, it is important to us, to also implement the journey time into the calendar overview.

 

I was wondering, whether it it possible to set a custom field for the start and end date of the event to our needs.

 

In my help desk i have the following available custom fields:

- event (date + time custom field; which resembles the time the agent shall be working on the problem solution, eg. be at the customer's site)

- work estimate (integer field; the agents sets the value to the estimated time he will be working on the problem solution; value = time in hours)

journey time (integer field; an estimate of the time the agent will spend to get to the customer site; value = time in hours)

 

Now i would like to set the start date of the calendar date as follows:

"event" minus "journey time"

 

and the end time as follows:

"journey time" plus "event" plus "work estimate" plus "journey time"

 

to create an event in the calendar, only the "event" custom field needs to be filled out. If "journey time" is left blank, it has a predefined value of "0". If work estimate is left blank, it shall have a predefinition of "1"

 

 

my question is, how to "calculate" the value of a date/time custom field which shall be source of the calendar required start and end date?

 

I have two problems: 

1) how can i calculate a date + time value with an int? the date + time value is dd/mmm/yy hh:mm and int is just a number... 

basically, i thought of a command which

- grabs the time from the date +time custom "event" field

- redifines the integer values of "work estimate" and "journey time" to a time value (eg. return "get(work estimate):00"

- adds or subtracts the time values by the rules above

- adds the time back to the date (of the event), so there is a date + time value again.

- return the calculated value to the new "start date" custom field, the calendar shall access.

 

2) how to implement the solution?

if i manage to get a working code, which can return my desired value, how can i implement it to my jira service desk? i am really sorry for this question, but i have no big programming background and have no idea how to modify my service desk the way i need it.

 

 

I am very, very glad for any help!! thanks in advance!

 

// for now we can just assume that all calculated dates will not exceed a day, eg. there wont be the case, that the event ended at 10 pm and the journey time is 3 hours, so that there would be a value of 1 am the next day.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events