How to autofill Acceptance criteria and Description Field (custom fields) using post function

Manoj July 19, 2023

Hello Community,

Greetings!

How to autofill Acceptance criteria and Description Field (custom fields) using post function in jira when user create a ticket with issue type Story and bug.

a predefine set of sentences pop up automatically.

 

kindly guide pls.

Thanks

M

2 answers

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2023

Hi @Manoj 

Sure - I would create an automation rule that populates those fields with the predefined text when the issue is created. If you are wanting them to populate after the issue is created. 

However, I suspect that you want the information in the fields at the time the user is populating the issue after clicking on the create button. Is that the case? Or the first one above? 

Manoj July 19, 2023

Yes John, I want this when I or user create a ticket then post creation acceptance criteria gets auto filled.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2023

Create an automation rule based on an Issue Created trigger. 

Then add any conditions as needed. 

Then add an action for Edit Issue. 

Choose the fields you want to change. 

Place the text in the fields. 

If you want to keep what the user may have put in those fields and then add your text, use: {{issue.description}} and then put your text on the next line. Same thing with the Acceptance criteria - just use {{issue.Acceptance criteria}} or whatever the actual field name is - it must match exactly, including the case. 

Manoj July 20, 2023

@John Funk  Hello, Thanks for replying back, but this is also populating when ticket is created but now PO has changed his mind after the demo, now we need this acceptance criteria before ticket creation, just when open form is open. 

I tried script runner but failed with custom field whereas "it works with "description" as description is system field. 

 

Below for Description but when i replaced description with "acceptance criteria" then does not work.

def desc = getFieldById("description")

def defaultValue = """h2. Objective of this user story:

AS A   -  <mention your role/persona>
I WANT TO  -  <mention what business you want to achieve>
SO THAT    -  <mention what are the benefits>


h2. Detailed description to achieve by this user story:

Please mention env name/links/configuration endpoints/user IDs/API names/other configuration details here.
 _
    """.replaceAll(/    /, '')

if (!underlyingIssue?.description) {
    desc.setFormValue(defaultValue)

How to write for acceptance criteria? kindly suggest. 

0 votes
Manoj July 19, 2023

@John Funk Hello, any suggestion/guidance pls?

Manoj July 19, 2023

@John Funk Could you pls suggest how to achieve this? - I would create an automation rule that populates those fields with the predefined text when the issue is created.

Like John Funk likes this
Manoj July 21, 2023

@John Funk Just to share with you, i have used scriptRunner to accomplish the requirement, and its working fine. Thanks alot for guiding thru Automation rules which even worked in other way around.

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2023

Great! Glad you got it working. 

Suggest an answer

Log in or Sign up to answer