Forums

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

Problem using JavaScript with Jira custom field

AK February 20, 2014

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

1 vote
RambanamP
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 Leaders.
February 23, 2014

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

AK February 23, 2014

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

0 votes
Jamie Saliga June 2, 2014

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
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events