Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add mention in comment using automation script

Shubhi Jain
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2024

Running data centre version

 

jira_comment = "[~accountid:\{{issue.fields.assignee.accountId}}]"
jira.add_comment(jira_id, jira_comment)
 
I am trying to add a comment on my Jira ticket using python automation script to mention the assignee name, but it is not honoring it and simply putting the whole string, how can I add mention?Screenshot 2024-01-29 at 3.56.48 PM.png

1 answer

0 votes
Kai Becker
Community Champion
January 29, 2024

Hi @Shubhi Jain 

welcome to the community and thank you for you question.

The syntax you are using is for the cloud version, DC does not have a accountId, so that your problem right now.

You should be able to just use:

[~{{assignee}}]

Hope this helps. 

Shubhi Jain
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2024

Hi @Kai Becker 

Thanks for the help, I want to add this assignee on runtime, in my python script this is how I am passing it now, it still does not workScreenshot 2024-01-29 at 6.13.02 PM.png

 

jira_comment = f"[~{{assignee}}]"
jira.add_comment(jira_id, jira_comment)
Kai Becker
Community Champion
January 29, 2024

Hi @Shubhi Jain 

I'm not sure about what you are doing, but I guess this is not properly formatted/escaped. Thats why the outer brackets get removed.

I don't think you need to use an f string, as it is just plain text.
Please try 

jira_comment = "[~{{assignee}}]"

Suggest an answer

Log in or Sign up to answer