Hi All,
I want to send a customized email during the transition.
I was using following code for the same reason in JIRA v 6.3 and it was working properly.
<% out << (issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Test Phase"))).toString() %> - <% out << (issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Client"))).toString() %>
but when I try the same in JIRA 7.3.8 , Script Runner 5.0.11 it gives me following error when validating the code. Can someone help me to sort out this issue?
Error
No such property: componentManager for class: groovy.lang.Binding
Thanks all for the support. :)
Following code worked for me. I added com.atlassian.jira.component in front of the ComponentAccessor
Test Phase: <% out << (issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('Test Phase')).toString()) %>
See jamie echlin-
An email template example:
Dear <% out << issue.assignee?.displayName %>,
The $issue.issueType.name $issue.key with priority <% out << issue.priority?.name %> has been assigned to you.
Description: ${issue.description}
<%
if
(lastComment)
out <<
"Last comment: "
<< lastComment
%>
Custom field value: <% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName(
"MySelect"
)) %>
Regards,
<% out << issue.reporter?.displayName %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Neta. Yeah I tried this code but it didn't work for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aravindi Amarasinghe
You must use ComponentAccessor instead of componentManager.
Try this
<% out << (issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Test Phase"))).toString() %> - <% out << (issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Client"))).toString() %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark Markov
Thank you for the answer. But it keeps throwing me this error
No such property: ComponentAccessor for class: groovy.lang.Binding
And I tried this code suggested in other ticket. And it just print the same code in the email body.
<% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Client")) %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm, it should work.
Then try to pass value via config variable. Like in this example
In my opinion this is much better way to make email templates, because it is not that ugly :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.