Forums

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

Validator that ensures that an issue has at least two attachments before allowing transition

Scott Federman
Contributor
December 2, 2017 edited

Can somebody recommend a way to validate that an issue has at least two attachments of any document type before allowing "approve" transition to staging. 

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
December 3, 2017

You'll need a bit of code to do this.

I'd do it with ScriptRunner as usual, adding a validator with a line for comparison saying something like

issue.getAttachments().size() > 2

Scott Federman
Contributor
December 3, 2017

Nic, as usual you come through. Thanks again for your help. 

I could use your help for another  (hopefully quick) issue. I need to script listeners to copy fields from story to sub-task as the field is updated. Its the same field in both issue types, I'm just trying to carry the data down to provide user visibility. 

Example

  • Story issue type: Order Request
  • Sub Task issue type: Part Order Request 
  • Field: PO Number

Update PO Number in Order Request and it populates down to PO Number field across all Part Order Requests. 

I have to do the same with a free text field as well called Vendor Name.

0 votes
Johnson Wang
Contributor
December 7, 2017

Hi @Scott Federman

You can do attachment count validation using the Power Scripts add-on.

We've actually put together a quick 5 min video tutorial that walks through all the steps you need to take to set this up. And we've also included the sample code we used, so you can just copy and paste it to test for yourself.

Hope this helps!

Johnson

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events