Forums

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

Unable to run automation on custom field and smart values using LookupIssues

tasha tokunova
March 17, 2022

I need a rule that will run on schedule, check JQL and send a list of tickets to a user.

I have issues with smart values when "send email"

Here's the email content:

{{#lookupIssues}}
<li>{{issuetype.name}}
Key+Summary: <a href="{{url}}">{{Key}} - {{summary}}</a>
All comments: {{comment}}
Returns last comment: {{issue.comments.last.body}}
Custom field value: {{issue.10033}}
</li>
{{/}}

 

When an email gets triggered I get blank values I miss {{issue.comments.last.body}} and {{issue.10033}}

1 answer

0 votes
Lotus Support
October 16, 2017

I tried this code that works similar

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

Issue issue = issue
// Get the comment, the user added in the form
def originalComment = transientVars.comment as String
def commentManager = ComponentAccessor.getCommentManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()

// Concat to the original comment, ours. Use \n for a new line
def comment = "-CANCELLED-" + originalComment
commentManager.create(issue, user, comment, true)




 

But i am getting also two lines in comment - one with customer entered text, and other with prefix
-CANCELLED-

xxxxx yyyyyyy added a comment - 5 minutes ago

We decided to cancel issue

 

xxxxx yyyyyy  added a comment - 5 minutes ago

-CANCELED- We decided to cancel issue

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events