I use the SIL programe(JJUPIN plugin) to create a sub task, and I want to attach a file to the subtask
except that when I attach a file during the creation of the sub task, this file is attached to the parent issue, not to a sub task
in the button have the code below :
string #{modifrmd} = createIssue("RMDI", #{key}, "Modification REMDOC", "Demande de modification de la REMDOC "+ #{key});
I use a creation screen of a subtask, which contains attachment boxes
how can i attach the file to the subtask??
thanks
Hello Assia,
You have to add in the context file (C:\jira\JIRA-Enterprise-4.3.4\conf\context.xml for me) JIRA datebase as a resource:
<Resource name="jdbc/JiraDS"
auth="Container"
type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:${catalina.home}/database/jiradb"
/>
if you use JIRA native database or something of this kind:
<Resource name="SqlServerTestDB"
auth="Container"
type="javax.sql.DataSource"
username="sa"
password="sa"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://JIRACLAIMS;instanceName=SqlExpress;databaseName=TestJira"
/>
if you are using another.
I shall write the code for the first case and notice the only difference is the database name for the other case:
string sk;
string old_path1;
string new_path1;
string path2;
string old_flName;
string new_flName;
string strSQL;
string delSQL;
sk=createIssue("TST", key, "test sub-task", "subtask with attachment" );
strSQL="select id, filename from fileattachment where issueid="+id+" order by id desc";
old_flName=getElement(sql("jdbc/JiraDS", strSQL),0);
new_flName=getElement(sql("jdbc/JiraDS", strSQL),1);
old_path1="C:/jira/home/data/attachments/"+project+"/"+key+"/"+old_flName;
new_path1="C:/jira/home/data/attachments/"+project+"/"+key+"/"+new_flName;
if (isNotNull(sk))
{
fileCopy(old_path1, new_path1);
attachFile(new_path1, sk);
deleteFile(old_path1);
deleteFile(new_path1);
delSQL="delete from fileattachment where issueid="+id+" and id="+old_flName;
sql("jdbc/JiraDS",delSQL);
}
I already tested it with JJUPIN 1.4.7 for JIRA 4.3.4 and it worked OK.
I avoided directly modify the database
that's why I used a vbs script and windows to retrieve the last attached file, then attach it to the subtask
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Was the problem solved? What version of Jira are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do you need more informations?
please help me it's urgent :'(
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.