Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Error when attaching files: JIRA could not attach the file as there was a missing token.

jhaughton
Contributor
February 14, 2018

Hi All,

We have a user who's unable to attach files to JIRA issues and receives the following errors when she tries:

-----------------------------------------

File "<<filename.ext>>" was not uploaded

JIRA could not attach the file as there was a missing token. Please try attaching the file again

-----------------------------------------

She's tried in various browsers, on various issues and with different file types (.jpg, .pdf, .png) and gets the same error every time. It doesn't matter how long she's been logged in to JIRA, and she's tried clearing her cache. Still no joy.

Any thoughts?

Many thanks,

Jodie

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 7, 2011

First, make sure you have 1, 2, 3, 4 and 5 as the options - the principle here is to get Jira to serve up all of the options, and then remove the ones you don't want after it's rendered.

Second, you didn't say where your javascript is, or how you've embedded it, but the way to do it in off-the-shelf Jira is to add it to the description of a custom field. I've had problems doing that sometimes, unless I added it to the last field appearing on the screen. You could also add it to select.vm or maybe use message fields, but the other methods all require coding or plugins.

Third, some simple code

{code}

<script language="JavaScript" type="text/javascript">
<!--
window.onload = function()
{
var listBox = document.getElementById("customfield_10312");
if (listBox)
{
for (j = listBox.length - 1; j>=0; j--)
{
if (listBox.options[j].value=="2") { listBox.remove(j); }
if (listBox.options[j].value=="4") { listBox.remove(j); }
}
}
}
// -->
</script>

{code}

saravanan subramanian
Contributor
September 7, 2011

Thank you

It worked. Thanks again

Saran

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events