Currently, I am using TemporaryAttachment API to get the number of attachments on a screen. The problem however is that when someone attaches a file on jira screen and unchecks the check box to the left of it, there is a file in temporary attachments collection but no file is attached to the issue. Effectively, this practice can bypass my validator. Is there any possible way to make a fullproof validation.
The key for the resulting map is https://developer.atlassian.com/static/javadoc/jira/5.1.6/reference/com/atlassian/jira/issue/IssueFieldConstants.html#ATTACHMENT
Thanks, works perfectly for me.
Map<String, ModifiedValue> modifiedValueMap = mIssue.getModifiedFields();
ModifiedValue modifiedAttachmentValue = modifiedValueMap.get("attachment");
List<String> modifiedAttachmentList = (List<String>) modifiedAttachmentValue.getNewValue();
if(modifiedAttachmentList.size()>0)
{
//success
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to be of any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello All,
Kindly help me for this problem, i am not able to get screen attachment name ..............
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dolanbay,
I have posted the code which worked for me below Radu's links. You can add the validator at create step for your requirement. Adding the validator at create will not allow anyone to create an issue without attachment.
Regards,
Smruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Smruti,
The links Radu shared doesn't work so could you paste the code you wrote?
One more favour, I also try to use a validator which checks whether an attachement is uploaded or not while creating an issue. I mean I don't want users to create an issue without an attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.