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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I have a groovy script where new updates of the methods is not corresponding


I did updates in java library and now the script displays errors in the lines 50/53/54

# def results =, user, PagerFilter.getUnlimitedFilter())

# for (def issue : results.getIssue()){

1 answer

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
// FUNCTION: CÁLCULO DE LAS HORAS LINEALES /////////////////////////////////
def calculoHorasLinealesQ1(Issue issue){
def cfManager = ComponentAccessor.getCustomFieldManager();
def horas= cfManager.getCustomFieldObject(16135); //'Horas lineales 2020-Q1'
def estimacionesFieldIds=[
'Estimación Loyalty 2020-Q1':16125,
'Estimación MCR 2020-Q1':16126,
'Estimación Campañas 2020-Q1':17409,
'Estimación iBlue 2020-Q1':16133,
'Estimación Salesforce 2020-Q1':16129,
'Estimación Voz 2020-Q1':16132,
'Estimación APP 2020-Q1':16117,
'Estimación Assistant 2020-Q1':16118,
'Estimación Booking Engine 2020-Q1':16119,
'Estimación Channel Manager 2020-Q1':16121,
'Estimación 2020-Q1':16127,
'Estimación Extranet & Switch 2020-Q1':16123,
'Estimación RMS 2020-Q1':16128,
'Estimación Sirius 2020-Q1':16131,
'Estimación Servicios y Pasarela & Message Broker 2020-Q1':16130,
'Estimación Customer Intelligence & ETL 2020-Q1':16122,
'Estimación Focus 2020-Q1':16124
if(horas != null && estimacionesFieldIds != null){
double hl = 0;
for (def id: estimacionesFieldIds.values()){
def estimacion = cfManager.getCustomFieldObject(id)?.getValue(issue);
if(estimacion != null) hl += (double) estimacion;
def changeHolder = new DefaultIssueChangeHolder()
log.warn(issue.key + "|" + hl);
horas.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(horas), hl),changeHolder); // Actualizar el campo de horas lineales con el valor de 'hl'
// JQL QUERY ///////////////////////////////////////////////////////////////
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def SearchService = ComponentAccessor.getComponent(SearchService)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
// edit this query to suit
def query = jqlQueryParser.parseQuery("issuetype = Épica AND category = 'BUSINESS DEVELOPMENT TECHNOLOGIES'")
def results =, user, PagerFilter.getUnlimitedFilter())
// ACCIONES SOBRE LAS ÉPICAS BDT ////////////////////////////////////////////
for (def issue : results.getIssue()){

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

131 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you