Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Script Runner Listener Issue Update

Batuhan Kandiran October 25, 2024

Hi,

i want to set new custom field by older values.

i am using function below,

issue.update { setCustomFieldValue("newcustomfield", "new value") }

is there any way to make this update operation without sending mail to all users.

 

2 answers

0 votes
Batuhan Kandiran October 25, 2024

i want to set customfield with value with groovy script 

 

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
GroupManager groupManager = ComponentAccessor.getGroupManager()
CustomField NewAssigneeGroupCF = customFieldManager.getCustomFieldObject("customfield_29311")
CustomField NewReporterGroupCF = customFieldManager.getCustomFieldObject("customfield_29312")
String startdate = '2024-10-01'
String enddate = '2024-11-01'



List<Issue> issues = new ArrayList<Issue>()
Issues.search(" assignee is not EMPTY and AssigneeGroup is EMPTY and created >= "+startdate+" and created < "+enddate+" and project = VSPR ").each { issue ->
issues.add(issue)
}

for(Issue issue : issues){
try{
issue.update { setCustomFieldValue(NewAssigneeGroupCF.getName(), findExactGroup(issue.assignee)) }
}catch(Exception ex){ return ex }
}
0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2024

Hi,

can you show us all your code please ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events