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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

190 views 1 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