You must define an attribute called 'key' for this tag.

I am new to Jelly. I am getting an error in my script:

Could not run script.
Extra Information: [hide]

Error: <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib">
Exception: org.apache.commons.jelly.MissingAttributeException: null:10:0: You must define an attribute called 'key' for this tag.
java.io.PrintWriter@13ed5baf

The issue is being updated in the database, and the comment can be seen.

File does not get attached.

Inserted date is a custom datetime field. It does not get updated either. What is going wrong?

&lt;JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib"&gt;
&lt;!--
    Add your own Jelly XML here
    For documentation on the JIRA tag library see:
    http://www.atlassian.com/software/jira/docs/latest/jelly.html
--&gt;
&lt;jira:CreateIssue project-key="PRJP" assignee="PRJadmin" summary="Example Summary 8:40" description="This is for 
the template" reporter="Neeraj" duplicateSummary="ignore" issueKeyVar="key"/&gt;
&lt;jira:AddComment issue-key="${key}" comment="A comment on ${key}"/&gt;
&lt;jira:AttachFile issue-key="${key}" filepath="D:\web-testing.txt" option="override"/&gt;
&lt;jira:AddCustomFieldValue name="Inserted_date" issue-key="${key}" value="07/Aug/13 9:01 PM"/&gt;
&lt;/JiraJelly&gt;


1 answer

1 accepted

0 votes
Eddie Webb Community Champion Aug 14, 2013

Yes, as called out on the documentation for this element, https://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jira%3AAttachFile

key is a required attribute that points to the issue key to add the attachment to.

Yeah, silly it is different than addComment, which uses issue-key for the same purpose.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,772 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot