The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I am looking for Listener custom Script for my query whenever the Priorities change the Comment to be added in Jira "Priorities changed from Major to Minor".I am not good in scripting.
I m writing script listener- Fires an event when condition is true but endup with error.
Selected Project : All Project
Event : Prioriy changed
Name of the event to fire : Priority changed
This is my script
import groovy.xml.MarkupBuilder
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.model.ChangeGroup
import com.atlassian.jira.model.ChangeItem
import com.atlassian.jira.issue.history.ChangeItemBean
def commentManager = ComponentAccessor.getCommentManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def priorityChange = changelog?.items.find { it['field'] == 'priority' }
def issue = event.issue
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
if (!priorityChange) {
logger.info("Priority was not updated")
return
}
logger.info("Priority changed from {} to {}", priorityChange.fromString, priorityChange.toString)
Error i received
The script could not be compiled:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script387.groovy: 17: unexpected char: 0xFFFF @ line 17, column 102. , priorityChange.toString) ^ 1 error
.
Hi @Sharadkumar Bangera ,
I believe your question has been answered.
To the benefit of those that might come across your post. Here is the link to the accepted answer :
https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Script-listener-to-add-comment/qaq-p/1541445
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.