Jira agile could not render html

Hey, All

After update jira-greenhopper-plugin from version 6.7.4  to 6.7.14 agile could not render html at card layout anymore this field is scripted field and work fine when you go to issue but at card layout get error the same visible at screen. I already try to clear plugin  cache and update universal plugin 

 

Thanks in advice for all hits

 

JIRA version 6.3.15

Agile version  6.7.14

SR version 4.1.3.15

universal plugin version 2.21.3

screen.PNG

6 answers

This widget could not be displayed.

Could you show some of the code for your scripted field? Particularly the HTML it is supposed to output.

This widget could not be displayed.

Sure script bellow 


import org.ofbiz.core.entity.GenericValue;
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.ProjectManager
import groovy.xml.MarkupBuilder

****

field+="<style>";
field+=".styled progress {";
/* Reset the default appearance */
field+="-webkit-appearance: none;";
field+="-moz-appearance: none;";
field+="appearance: none;";
field+="width: 150px;";
field+="height: 30px;";
/* Firefox */
field+="border: none;";
field+="background: #EEE;";
field+="border-radius: 3px;";
field+="}";
field+=".styled progress::-webkit-progress-bar {";
field+="background: #EEE;";
field+="border-radius: 3px;";
field+="}";
field+=".styled progress::-webkit-progress-value {";
field+="background-color: #CC0000;";
field+="border-radius: 3px;";
field+="}";
field+=".styled progress::-moz-progress-bar {";
field+="background-color: #CC0000;";
field+="border-radius: 3px;";
field+="}";
field+=".styled meter {";
/* Reset the default appearance */
/*field+="-webkit-appearance: none;";*/
field+="-moz-appearance: none;";
field+="appearance: none;";
field+="width: 140px;";
field+="height: 18px;";
/* For Firefox */
field+="background: #EEE;";
field+="border-radius: 3px;";
field+="}";
/* WebKit */
field+=".styled meter::-webkit-meter-bar {";
field+="background: #EEE;";
field+="border-radius: 3px;";
field+="}";
field+=".styled meter::-webkit-meter-optimum-value,";
field+=".styled meter::-webkit-meter-suboptimum-value,";
field+=".styled meter::-webkit-meter-even-less-good-value {";
field+="border-radius: 3px;";
field+="}";
field+=".styled meter::-webkit-meter-optimum-value {";
field+="background: #86CC00;";
field+="}";
field+=".styled meter::-webkit-meter-suboptimum-value {";
field+="background: #ffd351;";
field+="}";
field+=".styled meter::-webkit-meter-even-less-good-value {";
field+="background: #d04437;";
field+="}";
/* Firefox */
field+=".styled meter::-moz-meter-bar {";
field+="border-radius: 3px;";
field+="}";
field+=".styled meter:-moz-meter-optimum::-moz-meter-bar {";
field+="background: #86CC00;";
field+="}";
field+=".styled meter:-moz-meter-sub-optimum::-moz-meter-bar {";
field+="background: #ffd351;";
field+="}";
field+=".styled meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {";
field+="background: #d04437;";
field+="}";
field+="button {";
field+="display: inline-block;";
field+="border-radius: 3px;";
field+="border: none;";
field+="font-size: 0.9rem;";
field+="padding: 0.4rem 0.8em;";
field+="background: #69c773;";
field+="border-bottom: 1px solid #498b50;";
field+="color: white;";
field+="-webkit-font-smoothing: antialiased;";
field+="font-weight: bold;";
field+="margin: 0 0.25rem;";
field+="text-align: center;";
field+="}";
field+="button:hover, button:focus {";
field+="opacity: 0.75;";
field+="cursor: pointer;";
field+="}";
field+="button:active {";
field+="opacity: 1;";
field+="}";
field+="</style>";

******

field += "<div class=\"styled\">";
field += "<meter value=\"" + ActualCost + "\" min=\"0\" max=\"" + PlannedBudget + "\" high=\""+ h + "\" low=\"" + lo +"\" optimum=\"" + opt + "\"></meter></br>";
field += "<span>" + ActualCost.abs() + "/" + PlannedBudget.round();
if (remaining<0)
field += "<span style=\"color:#CC4600;\"> over " + remaining.abs() + " m/d</span>";
else
field += "<span> left " + remaining.abs() + " m/d</span>";
field += "</div>";

return field

 

This widget could not be displayed.

There are some things I don't get about your script. PlannedBudget is an int, but you're calling .round() on it. Also, you've got PlanedBudget at the declaration point, then PlannedBudget everywhere else.

I was able to get your script working in JIRA 7 with SR 4.3.5. Let me try switching back to your version of JIRA. 

This widget could not be displayed.

it probably escapes your html tags...?

This widget could not be displayed.

Yeah, it's definitely stripping out all the HTML tags, even when the field is configured to output HTML. Not sure if that's something JIRA changed with the advent of JIRA Software to replace/update JIRA Agile?

This widget could not be displayed.

Thanks guys for helps it start work's after change HTML 
BTW it's a litle strange the same code  work perfectly fine a JIRA Software but don't work at JIRA 6.3.15

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

262 views 1 3
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