Hi
I need to update a customer portal field value using groovy based on a different field value.
When a customer on fills in field A, field B value should be set using groovy script.
I tried using Automation for Jira but it only lets you set field B value to a constant, my value should be calculated by Groovy script. I also tried using Run a Script (Scriptrunner action in Automation) but I only managed to set value after the issue was created, not in realtime.
Is this possible in Jira?
If you have scriptrunner, the only option for real-time update option is with Behaviours.
If you create a behaviour configuration and map your service desk project and the appropriate request type, you can then add your field A to the behaviour configuration.
In the field A behaviour config, click the Add a Server-Side script and then write your groovy script. Depending on the type of fields for field A and B and what values in A should trigger what value in B, the script may be more or less complex.
Thanks.
Can I use it with Insight Object\s field though? This is what I got:
CIField = Form field ID: customfield_10123, value:
CIValue =
Behaviour code:
def CIField = getFieldByName("insight object")
log.error('CIField = '+CIField)
def CIValue = CIField.value
log.error('CIValue = '+CIValue)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok this works for Insight fields also. It just returns field value as String, not as ObjectBean
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a heads up about behaviour and insight field.
If the field contains a single object, the value will be a string with the object key.
If the field contains multiple objects, the value will be a list of strings (each with the object key).
This is independent of whether the field allows 1 or multiple. In other words, an insight field that allows multiple but only has 1 selected will return the same data as an insight field that allows a single value only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.