Getting "referenceerror cryptojs is not defined" in firefox when using hash256 in announcement banner.


I am using below code in announcement banner of JIRA

<script src="" type="text/javascript"></script>

// Fetch JIRA userid from metadta tags
   var customUserId = '';
   metaTagCollection = document.getElementsByTagName('meta');
   for (i=0;i<metaTagCollection.length;i++) 
     if(metaTagCollection[i].getAttribute("name") == "ajs-remote-user")
       customUserId = metaTagCollection[i].content;
       alert(customUserId); // it gets printed on alert message
       var hashedId = CryptoJS.SHA256(customUserId);//getting error here in FF debug
       alert(hashedId); // this is not getting printed in firefox but in IE

When I hit JIRA and login then above code successfully run in IE and I am able to get the hashed value of userId but when I do same in firefox it throws error in debugger and only first alert print not the second one.

JIRA version: 6.2.7

Firefox version: 32.0.3

IE version: 8

The test code below when saved as "test.html" (not using in JIRA announcement banner) runs fine on same firefox version.

<script src=""></script>
    var hash = CryptoJS.SHA256("Message");
    alert(hash); // gets printed on firefox as well. No error.


Please help me here about what I am doing wrong or need to do extra?

1 answer

1 accepted

0 votes
Answer accepted

I have downloaded the JS and localy added in a file on my server and its done.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

321 views 1 12
Read article

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