The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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 Champions.
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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 Champions.
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
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events