You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I tried to change the help text of a field with Scriptrunner Behaviours according to https://scriptrunner.adaptavist.com/5.3.1/jira/behaviours-api-quickref.html with setHelpText(), but it somehow adds an additional red text, instead of replacing the small gray text under the field.
How can I do this?
My initializer script:
import static com.atlassian.jira.issue.IssueFieldConstants.*
@BaseScript FieldBehaviours fieldBehaviours
def currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
def userLanguage = ComponentAccessor.getComponent(UserLocaleStore).getLocale(currentUser).language
def summaryLabel = "Staff Member Name"
def componentsLabel = "Organizational Unit"
def katTeamLabel = "Kanban Team"
def katTeamHelp = "Optionally define of which interdisciplinary teams the employee is part of."
This is still not updated on the API Quick Reference. It's a rather difficult problem to google too, since there are so many examples that modify the "Description" *Field* itself.
After playing around with the setDescription() method, it seems like it would be extremely useful to have some kind of resetDescription() method to change it back to the unmodified text (e.g. what's set in the Field Configuration).
Basically, we have a use-case where our user wants to conditionally set the description of a field, when a specific value is selected in another field. setDescription() lets us do this for that specific value, but if the user then changes their choice to a value that should *not* modify the description, it continues to display the modified description.
The only workaround I could think of here would be to abandon setting a description in the Field Configuration entirely, and use setDescription() calls in the Behaviour exclusively (for both positive and negative cases)