I have to import manually or by hand attachements files related to an issue
should i copy the files to i copy my old files to the folder C:\Program Files\Atlassian\Application Data\JIRA\data\attachments\ ??
and i also want to import or add exising issues created by another software
i am generating database backup of the old software
I just need to add the old issue created by a specific user and related attachement
please help
JIM (JIRA Importers Plugin - bundled with newest JIRA) supports importing attachments (at least a few recent versions) - but only together with issues. I.e. you cannot import attachments to an existing JIRA issue, but you can to a new one (created by JIM during the import).
I have used the SOAP API. Check the following code.
//Call
oSoapJiraClient.ImportAttachment(token, issueKey, filePath, new string[] { fileName });
//Soap Client
public bool ImportAttachment(string token, string issueKey,string filepath, string[] filenames)
{
bool result = false;
try
{
string[] attachmentData = new string[]{ FileToBase64String(filepath)};
result = jiraSoapService.addBase64EncodedAttachmentsToIssue(token, issueKey, filenames, attachmentData);
}
catch (Exception e)
{
throw e;
}
return result;
}
public string FileToBase64String(String FilePath)
{
string buffer = null;
try
{
byte[] fileBytes= File.ReadAllBytes(FilePath);
buffer = Convert.ToBase64String(fileBytes);
}
catch (IOException e)
{
throw e;
}
return buffer;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Louis how can i use your script ,
where to copy it? and how to run it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That won't work. You need code, or to directly hack the database (Which is hugely risky and can destroy all your data), because Jira tracks the attachments internally.
Personally, I'd choose to either use some SOAP in a script/program on my local machine, or, if you can drop the attachments on to the Jira server, I'd probably reach for a jelly script to get them into Jira from a temporary location http://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jira%3AAttachFile</p<>>
> and i also want to import or add exising issues created by another software
There are import options - start at http://confluence.atlassian.com/display/JIRA/Migrating+from+Other+Issue+Trackers</p<>>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.