How are you filling "params" in the IssueEvent Object??
By putting data into it.
I know that sounds facetious, but you need to explain the question more carefully because you're not being clear on what you mean. How are you using the issueevent object? Where's your code running? What are you actually trying to do? Why do you think you need to mess with the params in the event objects? Are you looking at extracting data from an event somewhere? Could you actually be talking about listener code where you put "params" in as part of the configuration? (The last one was what I assumed when I read the title, but that's because I'm tinkering with a listener at the moment)
OK, let me just elaborate.I have use case where i need to trigger a e mail on project level.I was using 4.0 version of jira where i was using this api to trigger mails-
sendLists(Set recipients, String sender, String senderFrom, EmailSubject emailSubject, Long templateId, String baseUrl, Map contextParams, com.atlassian.mail.MailThreader threader)
Now with the upgrade to 4.2, this API has changed and they have removed EmailSubject from the API, however i removed the this parameter and added a vm in the /subject folder as mentioned in the link .
http://confluence.atlassian.com/display/JIRA/Customising+Email+Content
But, this is not working because TemplateContext what i was using before is not comptaible ot this type, so i had to extend it with the TemplateContext with the one of jira-
com.atlassian.jira.mail.TemplateContext
This solved by compatitbilty issue but i was left in intantiating this object by the following contructor-
<strong><a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/mail/TemplateContext.html#TemplateContext(com.atlassian.jira.event.issue.IssueEvent,%20com.atlassian.jira.mail.TemplateIssueFactory,%20com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager,%20com.atlassian.jira.issue.RendererManager,%20com.atlassian.jira.util.JiraDurationUtils,%20com.atlassian.jira.event.type.EventTypeManager,%20com.atlassian.jira.web.action.util.DiffViewRenderer,%20com.atlassian.plugin.webresource.WebResourceManager)" rel="nofollow noopener noreferrer">TemplateContext</a></strong>(<a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/event/issue/IssueEvent.html" title="class in com.atlassian.jira.event.issue" rel="nofollow noopener noreferrer">IssueEvent</a> issueEvent, <a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/mail/TemplateIssueFactory.html" title="interface in com.atlassian.jira.mail" rel="nofollow noopener noreferrer">TemplateIssueFactory</a> templateIssueFactory, <a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/issue/fields/layout/field/FieldLayoutManager.html" title="interface in com.atlassian.jira.issue.fields.layout.field" rel="nofollow noopener noreferrer">FieldLayoutManager</a> fieldLayoutManager, <a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/issue/RendererManager.html" title="interface in com.atlassian.jira.issue" rel="nofollow noopener noreferrer">RendererManager</a> rendererManager,<a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/util/JiraDurationUtils.html" title="class in com.atlassian.jira.util" rel="nofollow noopener noreferrer">JiraDurationUtils</a> jiraDurationUtils, <a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/event/type/EventTypeManager.html" title="interface in com.atlassian.jira.event.type" rel="nofollow noopener noreferrer">EventTypeManager</a> eventTypeManager, <a href="http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/web/action/util/DiffViewRenderer.html" title="class in com.atlassian.jira.web.action.util" rel="nofollow noopener noreferrer">DiffViewRenderer</a> diffViewRenderer, com.atlassian.plugin.webresource.WebResourceManager resourceManager)
Now,I have IssueEvent object to be instantiated though my email notification is not issue level its project level, so i dont have any issue event listener to trigger emails, its link on click on button in my plugin i want to trigger a email.
To create IssueEvent Object i found some code-
<strong>IssueEvent issueEvent=new <a href="http://docs.atlassian.com/jira/latest/com/atlassian/jira/event/issue/IssueEvent.html#IssueEvent(com.atlassian.jira.issue.Issue,%20java.util.Map,%20com.atlassian.crowd.embedded.api.User,%20java.lang.Long)" rel="nofollow noopener noreferrer">IssueEvent</a></strong>(issue,Map params, com.atlassian.crowd.embedded.api.User user, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" rel="nofollow noopener noreferrer">Long</a> eventTypeId) ;
<strong>IssueEvent issueEvent=new <a href="http://docs.atlassian.com/jira/latest/com/atlassian/jira/event/issue/IssueEvent.html#IssueEvent(com.atlassian.jira.issue.Issue,%20java.util.Map,%20com.atlassian.crowd.embedded.api.User,%20java.lang.Long)" rel="nofollow noopener noreferrer">IssueEvent</a></strong>(issue,Map params, com.atlassian.crowd.embedded.api.User
user, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" rel="nofollow noopener noreferrer">Long</a> eventTypeId)
As my mail notification is project level, i dont want any issue or params to be filled and send , but as just to trigger notification i want to fill this so that i dont get NullPointer Exception.
It looks like you're new here. Sign in or register to get started.