How to solve rendering error?

shital chande September 6, 2019

Hi,

I am using a web panel module and that showing error.

screen shot->Screenshot_5.png

 

POM.XML ->

 <component-import key="templateRenderer" interface="com.atlassian.templaterenderer.TemplateRenderer"/> <!-- templateRenderer velocity-renderer-->
<web-panel name="ArchivingIndicator" i18n-name-key="archiving-indicator.name" key="archiving-indicator" location="atl.jira.view.issue.right.context" weight="1000">
<description key="archiving-indicator.description">The ArchivingIndicator Plugin</description>
<context-provider class="com.vps.jira.plugin.ArchivingIndicator"/><!-- archiving-indicator -->
<resource name="view" type="velocity" location="/templates/archiving-indicator.vm"/>
</web-panel>

 

ArchivingIndicator.java ->

 public Map<String,Object> getContextMap(ApplicationUser user, JiraHelper jiraHelper)
{
String get=Optional.ofNullable("myinput").orElse("");
Map<String, Object> contextMap = Maps.newHashMap();
//Map contextMap = new HashMap();
Issue currentIssue = (Issue)jiraHelper.getContextParams().get("issue");
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
//CustomField cf = customFieldManager.getCustomFieldObjectByName("Group Picker");
CustomField cf = customFieldManager.getCustomFieldObject("Group Picker");
Object val = currentIssue.getCustomFieldValue(cf).toString();
log.error("CustomField VAlue@@@@"+val);
if(val == null || val =="")
{
contextMap.put("daysAwayFromDueDate", currentIssue);
log.error(currentIssue+"@@@***");
return contextMap;
}
else
{
return contextMap;
}}

Archiving-indicator.vm ->

#set ($issue = $daysAwayFromDueDate)
#if ($daysAwayFromDueDate != "$daysAwayFromDueDate")
#else
<form name="deArchiveing" action="/plugins/servlet/dearchiving.jspa">
<!-- <span style="font-weight: bold; color: red;">$daysAwayFromDueDate</span> -->
<input id="clickMe" type="submit" value="Unarchive" onclick="DoSubmit();" style="font-weight: bold; color: red;" />
<input type="hidden" name="myinput" value="0" />
<script type="text/javascript">
var issueKey;
function DoSubmit()
{
issueKey = "$daysAwayFromDueDate";
var currentLocation = window.location;//current page address (URL) and to redirect the browser to a new page.
document.deArchiveing.myinput.value = issueKey+"@"+currentLocation;
document.getElementById("deArchiveing").submit();
}
</script>
</form>
#end

=======================

using JIRA 7.13.0.

anyone help me i dont understand why exact error is occured?

 

1 answer

1 accepted

0 votes
Answer accepted
Robin Meese February 28, 2020

I got a similar Error, did u fix it? And when how ?

shital chande February 28, 2020

Hi @Robin Meese ,

No, didn't fix it and I didn't get the resolved.

Robin Meese March 2, 2020

I was able to get this resolved.

 

This is my atlassian-plugin.xml:

<!-- My Web Panel in Issue View Velocity Template-->
<web-panel name="Template Module" key="template-module" location="atl.jira.view.issue.left.context" weight="100">
<context-provider class="de.conciso.contextproviders.EmployeeContextProvider" />
<resource name="view" type="velocity" location="templates/mitarbeiter.vm"/>
</web-panel>

My Resource is "empty":

public class EmployeeContextProvider implements ContextProvider {

@Override
public void init(Map<String, String> params) throws PluginParseException {

}

@Override
public Map<String, Object> getContextMap(Map<String, Object> context) {
return Collections.emptyMap();
}
}

My mitarbeiter.vm:

<html>
<body>
#set( $foo = "Velocity" )
Hello $foo World!
</body>
<html>

Have a look into ur target directory. target/jira/home/log/atlassian-jira.log

My errors were shown there.

 

If u need further assistance, just reply and I try to help u.

Suggest an answer

Log in or Sign up to answer