gioboa / jira-plugin

Jira plugin for VsCode
https://marketplace.visualstudio.com/items?itemName=gioboa.jira-plugin
MIT License
263 stars 41 forks source link

feat: Ability to Add Internal Comment #101

Closed devdaddy closed 5 years ago

devdaddy commented 5 years ago

Is your feature request related to a problem? Please describe. No.

Describe the solution you'd like When you right click on an issue in the explorer, it would be nice to be able to add internal comments as well. Maybe have submenu of the "Add a Comment" for Internal or Share with Customer.

Describe alternatives you've considered Alternative could be a user setting that can be toggled via a keyboard shortcut that will say whether you are making a private comment or sharing with customer.

Additional context No Additional context

gioboa commented 5 years ago

Hi @devdaddy , is internal comments a Jira feature? If yes, how I can create a new internal comment?

devdaddy commented 5 years ago

Yes it is an a Jira feature.

The JIRA Cloud REST API Documentation specifies the following schema for setting properties on comments when creating or updating a comment on an incident

https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issue-issueIdOrKey-comment-post

"properties": {
    "type": "array",
    "items": {
        "title": "Entity Property",
        "type": "object",
        "properties": {
            "key": {
                "type": "string"
            },
            "value": {}
        },
        "additionalProperties": false
    }
}

To make a comment on an issue internal (meaning only service desk agents can see the comment) you need to set the sd.public.comment key to have the value { "internal": true } Which can be achieved by passing the following JSON in the body of the create or update API request.

{
    "properties": {
        "key": "sd.public.comment",
        "value": {
            "internal": true
        }
    }
}

You would also need to set the Content-Type header on the request.

Content-Type: application/json
gioboa commented 5 years ago

Thanks for this clarification. It can be a good feature to implement. I will plan it in the next feature release. 👍

gioboa commented 5 years ago

I'm testing the feature and I marked the comment as internal by API, but in the web application seem to be equal to normal comment. Am I missing something?

devdaddy commented 5 years ago

are you able to share a screenshot of what the two different types look like? This is what an internal comment looks like in our web app.

Screen Shot 2019-03-16 at 2 55 03 PM
gioboa commented 5 years ago

I will check in my environment. Thanks. :+1:

gioboa commented 5 years ago

I checked in my environment, but I can't find where is the flag internal in a new comment.

devdaddy commented 5 years ago

When you are entering a new comment on an issue, if you have the Jira Service Desk Agent permissions, you will see a comment box like below, allowing you to comment internally or share with the customer.

Screen Shot 2019-03-18 at 1 11 12 PM

gioboa commented 5 years ago

Ok. Jira Service Desk Agent permissions do the "magic". :+1: do you think it's better new menu item or parse the message to find if begin with #internal?

devdaddy commented 5 years ago

I think a new menu item would make things user friendly.

gioboa commented 5 years ago

@devdaddy I cannot reproduce all the settings. 😢 Could you try this version for me please? jira-plugin-0.15.4-internal-comment.vsix.zip In this version you have the additional menu item. Thanks. 👍

devdaddy commented 5 years ago

Beautiful. Works as expected. Please let me know if you are in need of any collaborators.