The REST API documentation says that when you use GET and PUT, the JSON can contain something like:
"visibility": { "type": "role", "value": "Administrators" }
If I query Service Desk (JIRA) for a comment that was specifically marked as an "Internal comment", however, the JSON does not include this information. Looking at the JSON I get back, there is nothing that indicates that this is a private comment.
What am I misunderstanding here? How can I find out how Service Desk treats internal comments? I'm trying to write an importer and I need to keep private comments as private.
Community moderators have prevented the ability to post new answers.
I also needed this. I tried this after reading here. Heres what i tried assuming you know the comment id for the comment in question:
https://YOURJIRASERVER.com/rest/api/2/comment/YOURCOMMENTID/properties/sd.public.comment/
You'll get back something like this if its got a property for the service desk comment.
key value --- ----- sd.public.comment @{internal=false}
I think you can set this too if thats what you need, but haven't tried myself. For me i'm trying to set the visibility role something private on all comments that are 'Internal' via the servicedesk so i just need to find them!
Hope this gets you a little closer.
We dont have an API to cover this yet but the JSD code internally uses a "comment JSON property" to indicate the private-ness of comments.
{
"internal" : true
}
You need to use the new JIRA entity property code to set comment properties
https://developer.atlassian.com/display/JIRADEV/JIRA+Entity+Properties+Overview
Specifically
com.atlassian.jira.entity.property.JsonEntityPropertyManager
like this
def setSDCommentProperty(applicationUser: ApplicationUser, comment: Comment) {
jsonEntityPropertyManager.put(applicationUser, "sd.comment.property, comment.getId, "sd.public.comment", "{ "internal" : true}" , null, false)
}
In the future we will have an API to do this. Please feel free to contact me directly on brad.baker@atlassian.com for more details if this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brad, thank you for the example of how to setup a property. I would like to ask for help with the opposite - getting the value of this exact property. The problem is that JsonEntityPropertyManager's constructors require other objects which require other objects and so on recursively and I am not capable of delivering them. I am trying to get the value from a groovy script. If you could give me any kind of a hint, I'd be very greatful. Thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ɹǝʞɐq pɐɹq,
> In the future we will have an API to do this.
It's the future now.
I'm using the Rest API.
Is there any way to get the full details of a comment (including private-ness) without making a second HTTP request?
Thanks!
-Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any way I can check this value via Script Runner? I'm trying to send a custom email to the reporter when an issue is commented, but only when the comment is external.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's exactly what I would need too Chris:( never got around with this unfortunately. Guys please, help if you know how to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.