It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Validations cleares decription by resting customfield value

Paweł I'm New Here Thursday

Hi,

Is it possible to lock descripiton field when we push "create" button on JSD request type?

I've created JSD request type with one very simple behavoiur code on one coustomfield. Depending on what the requester chooses in this field, the description will be filled with various questions. The requester should fill his answer below them (in description) and fill other custom fields.

But if the requester skips one other required field and attempts to create a ticket, the validator notify Him that He skipped this field and re-sets my custom field to the previously selected value. This clears the description and inserts only questions there. 

Requester must refill His answers what's litte annying.

Can You help me with solution How to avoid this? I really would like to avoid creating dozens of new customfields for all the questions...

 

My code:

import com.atlassian.jira.component.ComponentAccessor
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def type = getFieldById("customfield_11032")
def desc = getFieldById("description")
def attach = getFieldById("attach-max-size")

if (type.value=="Letter"){
desc.setFormValue("""
System name: \n\n
ID: \n\n
Error description: \n\n
How it should be:
""")
attach.setDescription("""<span style="color:blue">Attach:<br>
- Screen<br>
- Report X</span>
""")
}
else if (type.value=="SMS" || type.value== "Email"){
desc.setFormValue("""
What is Error type?: \n\n
Error decription: \n\n
How it should be::
""")
attach.setDescription("""<span style="color:blue">Attach:<br>
- Screen<br></span>
""")
}

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you