Forums

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

Modifying Adaptavist template for dynamic Portal field description to use custom fields

Steve Letch
Contributor
January 23, 2023

Hi all

 

Was wondering if someone could help me make a slight modification to this adaptavist template to use a custom field to check field value instead of the priority field.

I want to test out dynamically setting my portal form field descriptions based on an Insight (assets) standard field and a Service Desk behaviours mapping. Any attempts I've made so far have just run into static type checking errors. Be cool if someone could let me know the minimum that would need to be changed. I'm consolidating my portal forms by using the Dynamic Forms function in the Extension for Service Management plugin and need to get dynamic field descriptions so I can re-use the same fields, but provide different guidance depending on the 'Request sub category' they selected.

 

I also need to add several 'ifelse' sections in there too.

 

import com.onresolve.jira.groovy.user.FieldBehaviours

import com.atlassian.jira.issue.priority.Priority

import groovy.transform.BaseScript

 

@BaseScript FieldBehaviours fieldBehaviours

 

if ((getFieldById(getFieldChanged()).value as Priority)?.name == "Highest") {

    getFieldById("description")

        .setLabel("Why do you need this and why so important?")

        .setDescription("Please explain why this is Highest priority including details of outage etc.")

} else {

    getFieldById("description")

        .setLabel("Why do you need this?")

        .setDescription("Tell us why you want this.")

 

}

 

Capture.PNG

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.22.4
TAGS
AUG Leaders

Atlassian Community Events