Forums

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

Problems modifying comment creation date

Eduard Diez
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.
October 18, 2020

Good morning community:

I have been trying to modify the creation date of a comment, and I have not seen from the API how to do it.

Do you know if it can be done from CLOUD?

I do this but not works... ;)

def issueKey = 'XXXXXXX'
def fechaNew = '2020-10-07T16:24:18.943+0200'
//result.body.comments.created
def result = put("/rest/api/2/issue/" + issueKey +"/comment")
    .queryString("overrideScreenSecurity", Boolean.TRUE)
    .header('Content-Type', 'application/json')
    .body([
          created : fechaNew
    ])
.asString()

if (result.status >= 200 || result.status <= 210) {
    return 'Success'
} else {
    return "${result.status}: ${result.body}"
}

or 

def issueKey = 'XXXXXXXX'
def fechaNew = '2020-10-07T16:24:18.943+0200'
//result.body.comments.created
def result = put("/rest/api/2/issue/" + issueKey +"/comment")
    .queryString("overrideScreenSecurity", Boolean.TRUE)
    .header('Content-Type', 'application/json')
    .body([
         comments: [
              created : fechaNew
          ]
     ])
.asString()

if (result.status >= 200 || result.status <= 210) {
    return 'Success'
} else {
    return "${result.status}: ${result.body}"
}

1 answer

1 accepted

0 votes
Answer accepted
Liam Green
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.
October 19, 2020

Hi @Eduard Diez 

I don't think you can modify dates such as ticket creation date, or comment creation date in Jira as they're set automatically

Eduard Diez
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.
October 19, 2020

Is the same that I thinking... but I must to aswer to the community... Cause the client demand this

Thank's

Like Liam Green likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events