Hi,
I'm trying to modify programmatically an issue field using the code i found here "https://developer.atlassian.com/download/attachments/5670239/JIRADEV-310811-0110-8.pdf" in the 145 page. I'm using JIRA 4.1.2, and that's my listener:
**************
public void workflowEvent(IssueEvent event){
IssueInputParameters iip = new IssueInputParametersImpl();
iip.setSummary("I am a new summary");
IssueService is = ComponentManager.getInstance().getIssueService();
UpdateValidationResult updateValidationResult = is.validateUpdate(event.getRemoteUser(), event.getIssue().getId(), iip);
if (updateValidationResult.isValid())
{
IssueResult updateResult = is.update(event.getRemoteUser(), updateValidationResult);
if (!updateResult.isValid()){}
}
}
**************
There's no warnings or errors on the JIRA console, but my summary doesn't change to "I am a new summary". So, how can i change the fields of my actual issue programmatically?
I've been looking the forum and i tryed this (https://answers.atlassian.com/questions/40245/how-do-i-save-a-custom-field-description-in-the-jira-data-base) too:
**************
ComponentManager.getInstance().getIssueFactory().getIssue().setSummary("I am a new summary");
ComponentManager.getInstance().getIssueFactory().getIssue().store();
**************
and this too:
**************
final IssueService.IssueResult issueResult = issueService.getIssue(null, event.getIssue().getKey());
final MutableIssue mutableIssue = issueResult.getIssue();
mutableIssue.setSummary("I am a new summary");
mutableIssue.store();
**************
Any idea. Thanks.
Alberto.