jira_attachment_uploader-single.rb
#Adds the attachment to the issue provided the file and issue object supplied
Adds the attachment to the issue provided the file and issue object supplied
Adds the attachment to the issue provided the file and issue object supplied
def addAttachmentToIssue(issueObj)
	attachment = JIRA::Resource::Attachment.new $client, issue: issueObj
	attachment_arr = "#{$attachement_location}".split("\\")
	attachment_name = "#{attachment_arr[attachment_arr.length() - 1]}"
	saved = attachment.save! 'file' => $attachement_location
	if "#{saved}" == "true"
		puts "File attachment[SUCCESSFUL] -- #{attachment_name} was uploaded successfully."
		write_to_file("File attachment[SUCCESSFUL] -- #{attachment_name} was uploaded successfully.", "info")
	else
		$upload_failed = true
		puts "File attachment[FAILED] -- #{attachment_name} upload failed."
		write_to_file("File attachment[FAILED] -- #{attachment_name} upload failed.", "error")
	end
end
def addAttachmentToIssue ( issueObj ) attachment = JIRA :: Resource :: Attachment . new $client , issue : issueObj attachment_arr = "#{$attachement_location}" . split ( "\\" ) attachment_name = "#{attachment_arr[attachment_arr.length() - 1]}" saved = attachment . save! 'file' => $attachement_location if "#{saved}" == "true" puts "File attachment[SUCCESSFUL] -- #{attachment_name} was uploaded successfully." write_to_file ( "File attachment[SUCCESSFUL] -- #{attachment_name} was uploaded successfully." , "info" ) else $upload_failed = true puts "File attachment[FAILED] -- #{attachment_name} upload failed." write_to_file ( "File attachment[FAILED] -- #{attachment_name} upload failed." , "error" ) end end
Adds the attachment to the issue provided the file and issue object supplied
Adds the attachment to the issue provided the file and issue object supplied
issueObj