In JIRA 7.5, there're a few issues with uploading attachments on a transition screen. These issues make attachment management unreliable, affecting JIRA notifications as well as add-ons that rely on attachment related events.
- Install JIRA 7.5
- Configure a workflow transition in which:
- A validator is set e.g. user must have Delete All Attachments permission to perform the transition (but any permission or validator will do)
- An event is triggerred from a postfunction e.g. Generic Event, Issue Updated event
- A transition screen is popped up that includes the Attachment field
- Configure the permission scheme so that Delete All Attachments permission is NOT granted to anyone (the purpose is to Fail the validator)
- Transition an issue using the transition in step #2 following these steps:
- Click the transition button to show the transition screen
- Attach a file to the Attachment field and transition (refer below for the Behaviors)
- Configure the permission scheme so that Delete All Attachments permission is granted to your user account (the purpose is to Pass the validator)
- Repeat step #4
- At step #4, since the Validator fails, the attachment is NOT added to the issue
- At step #6, since the Validator passes, the attachment is added and the notification event should record this - works in JIRA 7.4:
- At step #4, the Validator fails, however the attachment is still ADDED to the issue
- At step #6, the Validator passes and the event is fired, however the email doesn't show that an attachment was added:
- When a file is attached to the Attachment field on the transition screen, JIRA logs the followings:
- According to email@example.com, the potential cause is:
Method getTemporaryWebAttachment of TemporaryWebAttachmentManager doesn't return any TemporaryWebAttachment since version 7.5.0 of JIRA. In previous versions it worked correctly.
I have also tried method getTemporaryWebAttachmentsByFormToken as a possible alternative but it doesn't work too.
Fidel also points out the problematic code here.
- When a file is attached using More -> Attach files, there's NO problem
- There're reports that, at step #6, not only does the email not show that an attachment was added, but the added attachment also does not appear in the Issue's History