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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,121
Community Members
 
Community Events
184
Community Groups

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

Edited

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

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 12, 2020

Scripted fields do not have options, they calculate something and display it to the users.

Your desired behaviour is unclear to me, could you describe what the users will see (and do) without worrying about any part of the "how"?  What is the question you are trying to answer for your users?

Hi @Nic Brough -Adaptavist-  As of now in Jira issue search navigator we don't see attachments and while JQL subscription it is hard for users to understand if there is an attachment to the issue or not. To solve this I was thinking to have a scripted filed to say YES or NO if there are any attachments or not and add this field to issue navigator and to JQL subscription

@Nic Brough -Adaptavist-  Reason is, the set of users who receives email subscription will not have Jira access per business logic, hence a simple subscription which talks about tickets and say whether there is an attachment or not

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 15, 2020

Ah, I see.

I would go one step further than yes/no, and give your people even more information.

Try setting up a scripted field that

  • Has a "number" or "number range" searcher
  • Has a "number" template as the scripted field output
  • Has a script that says simply the below:

return issue.getAttachments().size()

This will put the count of attachments in front of your people, so they can sort by it and your "yes" could be searched for with "number of attachments" > 0

Hi Nic,

The approach helps in solving my problem.

Thank you for sharing your knowledge

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events