Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update field with the new value with a behavior

Jaime Basco
Contributor
January 18, 2023

Hola,

Estoy tratando de generar un resumen automáticamente con el valor de un campo.
El problema es que si cambio el valor de ese campo al crear la tarea, no actualiza el campo resumen con el nuevo valor.
He creado un comportamiento que funciona solo cuando actualizo la pantalla de creación o cuando actualizo el tema ya creado.

conducta:

importar com.atlassian.jira.component.ComponentAccessor
importar com.atlassian.jira.component.ComponentAccessor
importar com.atlassian.jira.event.type.EventDispatchOption


def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getDisplayName()
def resumen = getFieldById("summary")
def inf = getFieldById("customfield_15900").value
summary.setFormValue("${inf}" + ":" + " " + "${usuarioactual}")


¿Cómo puedo hacer que el campo de resumen se actualice con el nuevo valor que pongo en el campo del que tomo ese valor?

Gracias

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2023

Where did you put your behavior script?

It should be against the server-side script for the custom field that should trigger an update.

But be careful, you don't want future users that edit the issue to cause the summary to be refreshed to that user.

So either make sure your script only runs on create or if you want to allow the summary to be changed during future edits of the custom field, then you'll need to use the reporter details instead of the current user.

TAGS
AUG Leaders

Atlassian Community Events