The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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