Set Resolution Date via HAPI

Cristina Gatt January 24, 2024

I am trying to set the Resolution date for some issues using HAPI. 

From the examples I found for updating other dates, I tried the following but it is not working

Issues.search(jqlSearch).each{ issue ->
  issue.update {
    setResolutionDate('2024-01-01')
  }
}
I have permissions to edit, transition, resolve and close issues. Is it possible to update the Resolution Date via HAPI? Am I missing something?
Any help is much appreciated.

 

2 answers

0 votes
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2024

I don't think the resolution date can be set this way. It's designed to be set automatically when a resolution value is applied.

There is a very lengthy discussion here: https://community.atlassian.com/t5/Jira-Software-questions/Scriptrunner-w-Automation-Set-Resolution/qaq-p/2076978

Cristina Gatt January 25, 2024

Hi @PD Sheehan 

I understand that the resolution date should be set automatically when the issue is resolved but for some reason we have a couple of issues which do not have this set even though the resolution is set. These issues are messing up our reports and we want to set the resolution date to the date when the resolution was set. However, we still require to update the updated date so that internal tools can refresh the date regarding these issues. Hence why we are trying to avoid issue.store() as that does not update the date and does not record anything in the history (apart from the fact that Atlassian recommends against it).

0 votes
Bobby Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2024

Hi @Cristina Gatt ,

Have you run this script to check the expected format of the date?

 

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.util.DateFieldFormat

 

ComponentAccessor.getComponent(DateFieldFormat).getFormatHint()



Kind regards, 

Bobby

Cristina Gatt January 25, 2024

Hi Bobby,

Yes I did run the above and passed the date to the setResolutionDate() method in the formatting returned by the above script but it does not seem to update the date :(

Thank you.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events