jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

'@' mentions for users does not work

Open integrii opened this issue 1 year ago • 5 comments

Describe the bug When I use @user.name, it comes out as plain text in the JIRA UI. When I fetch an issue with an At mentioned member, I see the user prefixed with /~, However when I try to also put in /~user.name it comes out as plain text in the UI and \/~user.name in my jira-cli.

Please provide following details

  1. JiraCLI Version:
(Version="v1.0.0", GitCommit="", CommitDate="", GoVersion="go1.18.3", Compiler="gc", Platform="darwin/arm64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
v8.13.20#813020
  1. What operating system are you using? Also mention version.
macOS Montery 12.4
  1. What terminal are you using? Also mention version.
MacOS Terminal w/ `zsh`

To Reproduce

Steps to reproduce the behavior:

  1. jira issue create
  2. try to @user.name` mention someone in the description or comments
  3. notice that the user is not @ mentioned and the @user.name is plain text

Expected behavior @ mention binds to a user and notifies them as in the JIRA UI.

integrii avatar Jul 08 '22 20:07 integrii

Hi @integrii, on-premises installation use jira api v2 and it expects the data in this format [~displayname]. For example, the input below should render fine in Jira UI.

Please reach out to [~ankit] for clarification!

Screen Shot 2022-07-09 at 9 39 50 AM

Note that you'll need to use display name if its available. If you are unsure about the display name you can check it from jira issue assign command. The string inside the parenthesis ( is a display name.

Screen Shot 2022-07-09 at 9 38 36 AM

But yeah there seem to be some problem with escaping, I will check that. However tagging a user should work for valid input.

ankitpokhrel avatar Jul 09 '22 07:07 ankitpokhrel

Hello. I'm having the same issue. I'm not sure if it's because the username has spaces. I've tried two versions of this (with quotes and without) and still no luck. (This is a cloud Jira installation btw) image image

Here's my version info: (Version="1.1.0", GitCommit="3b93e147eac468ad985bdece27469153b4bb2814", CommitDate="2022-08-14T08:10:40+00:00", GoVersion="go1.18.3", Compiler="gc", Platform="linux/amd64")

Let me know if you need anything else. Thanks!

edlandm avatar Aug 19 '22 20:08 edlandm

I tried to put [~displayname] into a comment, but it is turned into \[](\~displayname\) when I view it via "jira issue view". On the web page, it is displayed as \[\~displayname\] when viewed as text.

$ jira version
(Version="1.4.0", GitCommit="eb842e18014303a575fde8e19508b3c7c13982c5", CommitDate="2023-05-09T07:09:45+00:00", GoVersion="go1.19.4", Compiler="gc", Platform="darwin/amd64")

SERVER INFO
-----------

Version:         8.20.15
Build Number:    820015
Deployment Type: Server
Default Locale:

funcode avatar Jun 17 '23 11:06 funcode

It seems markdown is not working in the comments. It can work with the following change:

index 79e160d..aecdf8c 100644
--- a/pkg/jira/issue.go
+++ b/pkg/jira/issue.go
@@ -274,7 +274,7 @@ type issueCommentRequest struct {

 // AddIssueComment adds comment to an issue using POST /issue/{key}/comment endpoint.
 func (c *Client) AddIssueComment(key, comment string) error {
-       body, err := json.Marshal(&issueCommentRequest{Body: md.ToJiraMD(comment)})
+       body, err := json.Marshal(&issueCommentRequest{Body: comment})
        if err != nil {
                return err
        }```

funcode avatar Jun 19 '23 10:06 funcode

I have the same problem !

1 - Jira issue assign does not show the user name, only the full display name 2 - Sending [~full display name] It appears literally like this in Jira

image

I'm missing something ?

jcstorino avatar Jul 18 '23 21:07 jcstorino