Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Description field value in JIRA getting disappeared in Edit screen in JIRA

Vasanta Kumaar April 27, 2021

Hi,

 

I have displaying default value in Description field in create screen using Behaviour Script runners. It is working Fine. We are facing a issue that when we try to edit the JIRA, in Edit screen the values disappear.

If we are trying to edit some other field and save, text in Description field disappear. 

If we edit description field then only edited values are viewed.

 

Can someone help, How to avoid the above issue.

 

Thanks,

Vasnatkumaar

2 comments

Comment

Log in or Sign up to comment
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2021

Hi @Vasanta Kumaar !

Did you check configuration of behaviour, is this only for create screen ?

also, could you check in console.log of browser some errors? and need to understand the cause

 

Cheers,

Gonchik 

Vasanta Kumaar April 28, 2021

In Console I am getting error as below screenshot

Capture.JPG

I am using below script

def desc = getFieldById("description")

def defaultValue = """h3. (i) SUMMARY
h3. (+) VALUE
h3. :) STAKEHOLDERS
h3. (!) TRACKINGS
h3. (!) METRICS
h3. (/) TO DO
h3. (+) THINGS LESS IMPORTANT THAN TIME TO MARKET
h3. (x) NOT TO DO
h3. (?) QUESTIONS
h3. (flag) DEPENDENCIES

h3. (*) AC
_*Given*_
_*When*_
_*Then*_

h3. (*r) CORNER CASE
_*Given*_
_*When*_
_*Then*_

h3. (*g) DOD
(off) code is reviewed
(off) code is covered by unit and acceptance tests
(off) code is deployed in QA
(off) AC passed in QA (turning FT on to test it if necessary)
(off) At least 1 people (dev, UX, PO,...) that did not develop the story did the AC in QA
(off) code is deployed in all PROD environments
(off) AC passed in PROD (turning FT on to test it if necessary)
(off) funnel happy path is working (checking it manually or automatically)
(off) documentation is kept up-to-date
(off) external stakeholders are notified that the feature is completed/activated
(off) necessary jiras have been opened for cleanup (ab test, FT, tech debt, ...)"""
if ((getActionName() == "Create") && (issueContext.issueType.name =="User Story")){
desc.setFormValue(defaultValue)
}
else {
desc.setFormValue("")
}
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2021

Please, double check mapping other behaviours as well, 

Vasanta Kumaar April 28, 2021

I am mapped only the JIRA project which needs the default value and all the issue types.

I am also facing the edit screen issue with other issue types to in the same JIRA project.

Lih Yao Tiong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2021

Hi @Vasanta Kumaar ,

I have checked on your script, and I would suggest you remove the condition of checking the issue on the create screen. This might cause your "else" condition fire when the issue on the edit screen, and that's why the script will erase your value.

I hope my explanation makes sense to you.

Vasanta Kumaar April 28, 2021

HI Tiong, 

 

I have tried it and if I remove the condition and checked.

When user tries to change the issue type, they can able to see the default value still with other issue types.

Thanks,

Vasantakumaar.

Lih Yao Tiong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2021

Hi @Vasanta Kumaar ,

May I confirm with you if the original problem was solved but the new problem occurs?

Are these the steps to replication the issue?

  1. Set the default value only for issue type A.
  2. Create new issue > select issue type A > showing the default value > select issue type B > The default value is still showing
Vasanta Kumaar April 28, 2021

Hi @Lih Yao Tiong ,

 

If we remove the if else condition, I am facing issue as you told.

  1. Set the default value only for issue type A.
  2. Create new issue > select issue type A > showing the default value > select issue type B > The default value is still showing
Lih Yao Tiong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2021

Hello @Vasanta Kumaar ,

Sorry for my previous message might be confusing for you.

My suggestion is not to remove the if-else condition, just the condition checking on the create screen.

This is what I mean:

def desc = getFieldById("description")

def defaultValue = """h3. (i) SUMMARY
h3. (+) VALUE
h3. :) STAKEHOLDERS
h3. (!) TRACKINGS
h3. (!) METRICS
h3. (/) TO DO
h3. (+) THINGS LESS IMPORTANT THAN TIME TO MARKET
h3. (x) NOT TO DO
h3. (?) QUESTIONS
h3. (flag) DEPENDENCIES

h3. (*) AC
_*Given*_
_*When*_
_*Then*_

h3. (*r) CORNER CASE
_*Given*_
_*When*_
_*Then*_

h3. (*g) DOD
(off) code is reviewed
(off) code is covered by unit and acceptance tests
(off) code is deployed in QA
(off) AC passed in QA (turning FT on to test it if necessary)
(off) At least 1 people (dev, UX, PO,...) that did not develop the story did the AC in QA
(off) code is deployed in all PROD environments
(off) AC passed in PROD (turning FT on to test it if necessary)
(off) funnel happy path is working (checking it manually or automatically)
(off) documentation is kept up-to-date
(off) external stakeholders are notified that the feature is completed/activated
(off) necessary jiras have been opened for cleanup (ab test, FT, tech debt, ...)"""
if (issueContext.issueType.name =="User Story"){
desc.setFormValue(defaultValue)
}
else {
desc.setFormValue("")
}

Everything should work fine with this.

TAGS
AUG Leaders

Atlassian Community Events