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."
)
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.