Forums

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

How can I add text to description field?

Defny March 20, 2018

Hello Everyone,

I would like to add below text in my description field.

Expected behavior:


Observed behavior:

I checked the .vm files but unable to to find any file associated with this field. Kindly help me on this.

Thank you in Advance.

 

1 answer

1 accepted

1 vote
Answer accepted
Tarun Sapra
Community Champion
March 20, 2018
Defny March 22, 2018

Thank you for this.

I  have one more doubt.

We have two tab(Field Tab and Customer Information) as shown in the screenshot. In the first tab we have description field and customer description in second tab in which we want some values. I have the below script. There is no error but when i go back and create the issue i dont see the values. Please check where i am wrong.

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;

def desc = getFieldById("description")

def defaultValue = """Initial condition:

Stimulus applied:


""".replaceAll(/ /, '')

if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
def desc1 = getFieldById("Customer Description")

def defaultValue1 = """
ATTENTION: PLEASE DO NOT CHANGE THE ORDER OF THE FOLLOWING INFORMATION !!!!

Teiledaten / part information :
Teilenummer / part number: 5WA 937 086
EE- Gerätetyp / EE- device type: BCM MQB37W
HW:
SW:

====================================================================

Customer Description:

""".replaceAll(/ /, '')

def customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField customField = customFieldManager.getCustomFieldObjectByName("Customer Description");
String customerDescription = customField.getValue(underlyingIssue);
//if(customerDescription !=null && ! customerDescription.isEmpty()){
desc1.setFormValue(defaultValue1)
//}

 

Thank you!

 

Tarun Sapra
Contributor
March 23, 2018

Please accept the answer/upvote so that others know this as an accepted answer. thanks.

Defny March 23, 2018

Custom field.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events