Problem using JavaScript with Jira custom field

Hi,

I am using java script in description field of a custom field (of text type) to render it as a hyperlink (anchor tag).

But on editing/inline editing the jira-issue, the field value gets rendered as a normal text and not as a hyperlink.
On page refresh the field gets displayed again as hyperlink.

I tried "alerting" the value, it appears that after the edit operation (which is an ajax call) value of the custom field div changes to some "form".

Posting this here hoping some one who has come across similar problem could help me.


Thanks,

Aravind

2 answers

This widget could not be displayed.

you need to use following event for inline edit

JIRA.CONTENT_ADDED_REASON.inlineEditStarted

check this doc

https://developer.atlassian.com/display/JIRADEV/Inline+Edit+for+JIRA+Plugins

Thanks Prasad for the reply :) Going through the doc to figure out the solution.

This widget could not be displayed.

i found this exact same issue with my javascript intensive plugin. The field is getting re-rendered without the javascript getting run. Add your rendering logic within the following JIRA.bind

JIRA.bind( JIRA.Events.NEW_CONTENT_ADDED, function(e,context)

{

// rerun javascript here

});

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published 8 hours ago in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

43 views 0 8
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