All i wanna do is compare 2 custom datetime fields and show the difference in a custom numeric field (in hours if possible)
The closest i got is here:
import java.time.LocalDate
import java.time.LocalDateTime;
import static java.time.temporal.ChronoUnit.MINUTES
def reqagreeddate = LocalDateTime.parse(issue.fields.customfield_10029)
def resolutionDate = LocalDateTime.parse(issue.fields.customfield_10032)
def dateDifference = MINUTES.between(reqagreeddate, resolutionDate)
issueInput.fields.customfield_10031 = dateDifference
but i got the following ERROR
2019-10-25 18:37:53.523 ERROR - Text '2019-10-25T00:00:00.000-0300' could not be parsed, unparsed text found at index 23
I resolved this by giving up and using an project automation plugin for jira called Automation for jira... Scriptrunner still very poor for cloud version in my opinion. With this new tool i was able to do all i wanted in less than 2h.