Forums

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

How to add custom field which says Yes or No if...?

Sysad
Contributor
April 8, 2020

Hi

I would like to add a scripted custom field with dropdown options Yes & No. I want the scripted field to check for attachment(s) in an issue and set custom field option as yes if there are attachments, else No.

What is the best way? and I have no experience in groovy and accessing attachments.

Any help is appreciated, Thanks 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Ariel Dor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2025

3 years later, I've found a solution to use the utils class within or  without an automation rule - 

class SlaUtils {
private MutableIssue issue
private Logger log
private Object ruleContext

SlaUtils (MutableIssue issue, Logger log, ruleContext=null) {
this.issue = issue
this.log = log
this.ruleContext = ruleContext
}

 

then I can either call it either with:

 SlaUtils slaUtils = new SlaUtils(issue, log)

in case I am calling from console without a rule context, or with:

 SlaUtils slaUtils = new SlaUtils(issue, log, ruleContext)

from actual automation rule.

 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events