Behaviour plugin doesn't pickup the time value while fetching value for date time type custom field

FormField startDate=getFieldById("customfield_XXXX")


now if suppose customfield_XXXXX has value 27/Apr/15 10:30 AM.


I am getting startDateValue1 as Mon Apr 27 00:00:00 UTC 2015 which is missing the time part completely.

JIRA Version : 6.1.7


Behaviour Plugin : 0.5.10

Has anyone noticed this

Thanks in advance


Best Reagrds,



3 answers

1 accepted

0 votes
Accepted answer

I have written a groovy script to do the needful , can close this thread now. Any research will still be an help.




Hi Sumit, Where is the script??

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.event.type.EventDispatchOption;
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.MutableIssue
import org.apache.log4j.Level
import org.apache.log4j.Logger
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import java.sql.Timestamp

Logger log = Logger.getLogger("Filling EndTime")

ComponentAccessor comAcc=new ComponentAccessor()
CustomFieldManager cfm = comAcc.getCustomFieldManager()

CustomField startTime = cfm.getCustomFieldObject('customfield_ABC') // id to be changed
CustomField endTime = cfm.getCustomFieldObject('customfield_BCD') // id to be changed
CustomField duration = cfm.getCustomFieldObject('customfield_CDE') // id to be changed


// log.debug("Updating Time")
// log.debug("startTimeValue ::: ${startTimeValue}")
// log.debug("durationValue ::: ${durationValue}")
// log.debug("endTimeValue ::: ${endTimeValue}")
long value
if (startTimeValue!=null && durationValue!=null){
value=((startTimeValue.getTime()/(1000*60)) + durationValue)*1000*60
newtime =new Timestamp(value)
def changeHolder = new DefaultIssueChangeHolder();
endTime.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(endTime), newtime),changeHolder)


return null

Hi Jamie, I'm meeting the same issue when trying to set a default date of a date/time custom field value from another one.

Can you help us please?

FormField slaveField1 = getFieldById ("customfield_10406")
FormField masterField = getFieldById ("customfield_10404")
Date master = (Date) masterField.getValue()
slaveField1.setFormValue(master.format("dd/MM/yy HH:mm"));


I am facing the issue. How do i get the date and time from datetime custom field?

I have a field called Release Window as dropdown (Window A, Window B) and another field RFC deployment date / time as Custom Datetime field.

If the user choose any time another than Tuesday 6 PM to Wednesday 5.30 AM, i would like to display a error message immediately. I am using behavior script to achieve this.

The issue is ld_rfcdeploymentdate returning the value only with date and time stamp is showing as 00.00.0

FormField rfcdeploymentdate = getFieldByName ("RFC Deployment Date")  

Date ld_rfcdeploymentdate = rfcdeploymentdate.getValue()


Window ATuesday 6:00pm - 5:30am
Window BThursday 6:00pm - 5:30am

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,586 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you