I want to add description help text for the reporter field via behaviours in script runner to include html links as this can't be applied in the normal format of editing descriptions in JIRA admin set-up.
Please can you provide a dummy example that I can apply for a) Reporter (help text to a web link) and also b) to a custom field that is a user picker format.
Hi,
With a behaviour, adding the field(s) that you want to affect, you can use this script to add a help text for it.
getFieldById("reporter").setHelpText("HELP TEXT <a href=\"www.google.com\">HELP</a>")
Replacing "reporter" by the id of the field you can define which field to use and you can use multiple fields by adding them.
Official Docu here.
As an example, I did it with the Reporter field:
Hope it helps.
Regards.
Marcos
Thanks for the example. I'm trying to add default text to a Root Cause field. I tried two different ways, but when I save it and open a jira it still doesn't show up. I checked that my behaviors modules were enabled. Anyone know what might be wrong?
Playing with behaviors plugin:
1. I set the mappings to only Incident and Problem.
Incident Management System (
Incident)
Incident Management System (
Problem)
2. I tried this in the behaviour settings Initialiser section but nothing showed up on the jira form:
def rootcause = getFieldById("Root Cause")
def rootcauseValue = """
h2. Root Cause:
h2. Workaround (solution) Actions:
h2. Preventative/Corrective Actions:"""
if ( ! rootcause.getValue()) {
rootcause.setFormValue(rootcauseValue)}
3. I also tried this in the behaviour settings initialiser section, but still didn't work:
getFieldById("Root Cause").setHelpText("Root Cause: \nWorkaround solution Actions: \n Preventative/Corrective Actions:")
Anyone know what I'm doing wrong here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alicia Pena
In your second example it will work if you change the name Root cause in row 1 to ("customfield_xxxxx")
Where xxxxx is the field Id. Now you ask getFieldById not the get Field ByName.
Hope that helps!
/Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found this example that sort of worked. Formatting is still a problem, but it does show:
def desc = getFieldById("description")
def defaultValue = """
Problem Statement: An outline of the problem we're trying to solve or task to accomplish
Solution/How: How we plan to fix or solve the issue
Definition of Done: What constitutes this task being marked as completed
Stakeholders: Who are the stakeholders? DevOps/Engineering etc? Do we need buy-in or feedback to close the task? Should get confirmation of the task being completed up to stakeholders standards before moving to done status
Notes: Additional notes so others can read the ticket and grasp extra prerequisite information
""".replaceAll(/ /, '')
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.