In a behaviour - want to get the created date of the issue

Karla Russell November 29, 2018

 

The older the current issue is, the larger I want the LastUpdatedDateValue to be.

It really doesn't like def Date createdDate = getFieldById("created")

// get updated date
double LastUpdatedDateValue = 0d; // updatedDate value
def Date createdDate = getFieldById("created");

//def Timestamp createdTime = issue.getCreated();
//def Date createdDate = new Date(createdTime.getTime());
def Timestamp todayTime = new Timestamp(System.currentTimeMillis());
def Date todayDate = new Date(todayTime.getTime());

if (createdDate > todayDate - 2) {
LastUpdatedDateValue = 2d;
} else if (createdDate > todayDate - 7) {
LastUpdatedDateValue = 7d;
} else if (createdDate > todayDate - 14) {
LastUpdatedDateValue = 14d;
} else { // greater then 8
LastUpdatedDateValue = 16d;
}

 

What should I be using to get the create date?

Thanks. 

1 answer

0 votes
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2018

Hi @Karla Russell

Could you try 

def date = getFieldById("create-date") 
Karla Russell December 5, 2018

Haven't had a chance to verify this yet.  Thanks Fazila!  

Suggest an answer

Log in or Sign up to answer