Add a Html Links to Custom Fields

Hello,

We are working on upgrade fro version 4 to 5.2.8. We need an abililty to add link to the document which is stored in external systym to the custom field.

We have made some customization in description section of one of the custom fields, as follows:

מהות השינוי ואופן מימושו

</br>

</br>

<script type="text/javascript" language="javascript" src="http://www.xxxx/globalScripts/DM_JscriptPointers.asp">

</script>

<script>

function addDM2ReqDet() {

var From1;

var To1;

var From2;

var To2;

var MyLink;

var res;

res = SearchDocs(0);

MyLink = res;

From1 = MyLink.indexOf('DOCNUMBER');

To1 = MyLink.indexOf('/DOCNUMBER');

From2 = MyLink.indexOf('NAME');

To2 = MyLink.indexOf('/NAME');

if (To1 > 0) {

document.getElementsByName("customfield_10403")[0].value = document.getElementsByName("customfield_10403")[0].value + '<div style="text-align: right; direction: rtl; "><a href="http://www.xxxx/opendocsdocument/default.aspx?Library=RAFDOCS&DocNumber=' + MyLink.substring(From1 + 10, To1 - 1) + '&DocName=' + MyLink.substring(From2 + 14, To2 - 4) + '&NotCloseWindow=true&MatanDocName=RAF_' + MyLink.substring(From1 + 10, To1 - 1) + '" target="_blank">' + MyLink.substring(From2 + 14, To2 - 4) + '</a></br></div>';

alert(document.getElementsByName("customfield_10403")[0].value);

document.getElementsByName("customfield_10403")[0].selection.setContent("AAAA");

}

}

function addDM3ReqDet() {

alert(document.getElementsByName("customfield_10403")[0].value);

}

</script>

<input id="AddDM3ReqDet" type="button" value="Test Value" onclick="addDM3ReqDet();" />

<input id="AddDM2ReqDet" type="button" value="Attach DM File" onclick="addDM2ReqDet();" />

Press the button to add a link to a DM file.

</br>

</br>

when we are trying to pushe an "Attach DM File" button it connects to the document storage system,

but link is not created, and we get error messages as follows:

Any help will be appreciated,

Best Regards,

Slava

1 answer

1 accepted

The problem was solved by replacement of tinyMCE.getElementsById to tinyMCE. getElementsByName

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,782 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