Forums

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

Auto-populate Description field takes times and required to click visual before loading the values

Gian Israel Nampi
Contributor
October 20, 2020

Hello Everyone,

 

I got a problem with Behavior Script by Adaptavist Script Runner. 

Jira Server Software Version: 8.5.4

Scrip Runner Version:  6.7.0 

 

Requirements:
1. Auto Populate System Field: "Description" when the System Field: "Component/s" Value is "true" and IssueType is "New Request"

2. Clear the description field when the "myValue" is removed from the component field and Issue Type Changed.

 

Procedures:
1. Create Behavior Script
2. Mapped the Project, Issue Types and Workflow
3. Create script in "Initializer"

 

Script:
------------------------------------------------------------------------------------

def components = getFieldById("components")
def componentsValue = components.getValue()
def descriptionField = getFieldById("description")

def defaultValue = """*Please fill in information related to your request:*
Specification :
- CPU
- RAM
- HDD
- OS (Windows, Linux)"""

if (componentsValue.toString().contains("myValue")) {
descriptionField.setRequired(true)
descriptionField.setFormValue(defaultValue)
}
else if (componentsValue.toString().contains("null")) {
descriptionField.setFormValue("")
}------------------------------------------------------------------------------------

 

Testing:
1. UAT Server: I have a problem with my behavior script. I tried both with Initializer and Server-Side script and it gives the same bug/issue.
2. My Personal Server: The same result, therefore I conclude that there is an issue with Behavior or with my script.

How to meet the bug/issue?
1. Create an Issue
2. Add "myValue" to the component/s

3. Description is not populating. IF:
A: You just wait for it to show the description values

4. Description is populating IF:
A. After adding the component value. clicking inside the component bar or (whitespace) makes the description value appear.
B. After adding the component value. pressing tab up to the "Visual" of description makes the description value appear.

Can you explain why this occur? is there's a problem with my script? or its the Script Runner?

 

Thank you.

 

1 answer

1 accepted

0 votes
Answer accepted
Gian Israel Nampi
Contributor
October 22, 2020

Hello all,

 

This is fixed by changing the Field from Description into Component/s

 

GGWP!

 

fixed issue.PNG

Suggest an answer

Log in or Sign up to answer