Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

×
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
AUG Leaders

Atlassian Community Events