How to close the ticket with updated using scriptrunner Groovy script.

mohit panwar July 8, 2021

Hi Team,

I have a requirement to close the particular issue type of my project using some comments. Need your help to have a code in Groovy Script. Thanks in Advance for your help.

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2021
mohit panwar July 10, 2021

Thanks, Martin for the response.

Below is another question that is on high priority. Please give some guidance I am new to script runner.

 

I need some help. How to get the value of the custom field from the issue type. Then printing and using that variable further.

I have an issue type with the name "TEST1-5". when trying to print the value for issue and csChangeArea I am getting "NULL" value. Please help and suggest how to use th

When 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.ModifiedValue;
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder;

def issueManager = ComponentAccessor.getIssueManager()
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("TEST1-5")
def csChangeArea = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("Username")

log.info("My script variable new value : " + issue)

log.info("Custom field value : " + csChangeArea)

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2021

Hi @mohit panwar , create a new question for new topic, please. If you mention me, I will get notification and I can check it :)

Suggest an answer

Log in or Sign up to answer