Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is comment id sequential in jira rest api issue response

Jitendra Kumar April 14, 2016

Is commentID "ID" sequential and unique, can i assume greatest/highest comment id  will be the latest comment

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2016

Generally, within an individual issue, that is a safe assumption.

Jitendra Kumar April 15, 2016

Thanks Nic !!! I will assume  highest/greatest comment id will have latest comment.

Do you have any other way to pull the latest comment.

The reason of going with highest/greatest comment id is :

I tried to put the comment using rest api program in loop and found that same timestamp has been recorded for more than one comment and it is happening because millisecond is getting ignored. 

{
"id" : "920608",
"body" : "Test_1,
"created" : "2016-04-14T12:25:06.000-0500",
"updated" : "2016-04-14T12:25:06.000-0500"
}, {
"id" : "920609",
"body" : "Test_2",
"created" : "2016-04-14T12:25:06.000-0500",
"updated" : "2016-04-14T12:25:06.000-0500"
}

So i can't use timestamp to find out latest comment . So , thought of using highest/greatest comment id to get the latest comment ...

Am I doing right ?My requirement is get latest comment for an individual story/epic

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 16, 2016

Yes, I think you are - when someone starts a comment (i.e. clicking "save"), the code gets a guaranteed unique id and the counter moves on, so the next commenter gets a newer, higher id.  Even if they click in the same millisecond, the person whose request arrives second will get the higher id.

Jitendra Kumar April 16, 2016

Thanks Nic !!! 

TAGS
AUG Leaders

Atlassian Community Events