Hello, I need to refresh the issue without closing the window in order to update in “real time” the changes i´m using the method AP.jira.refreshIssuePage(); and this is my code:
// these 4 values will be installation dependent
def input1CfId = 'customfield_10048' // Cantidad disponible
def input2CfId = 'customfield_10034' // Costo Unitario
def outputCfId = 'customfield_10050' // Valor Total de inventario
def projectKey = "BP"
if (issue == null || issue.fields.project.key != projectKey) {
logger.info("Wrong Project ${issue.fields.project.key}")
return
}
def input1 = issue.fields[input1CfId] as Double
def input2 = issue.fields[input2CfId] as Double
if (input1 == null || input2 == null) {
logger.info("Calculation using ${input1} and ${input2} was not possible")
return
}
def output = input1 * input2
AP.jira.refreshIssuePage();
if (output == (issue.fields[outputCfId] as Double)) {
logger.info("already been updated")
return
}
put("/rest/api/2/issue/${issue.key}")
.header("Content-Type", "application/json")
.body([
fields:[
(outputCfId): output
]
])
.asString()
Scriptrunner interface give me this:
[Static type checking] - The variable [AP] is undeclared @ line 23, column 1
[Static type checking] - No such property: jira for class: java.lang.Object @ line 23, columna 3.
Could someone help me?