Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,077
Community Members
 
Community Events
168
Community Groups

Comment is not added in Jira issue although the transition is valid and successfully made

I am supposed to perform a transition in Jira and write a comment in an issue. Here is the code that I wrote in my script console for testing purposes below. The problem is that my transition is made as shown in the screenshot below but no comment gets added although I specified the comment in the input parameters through this line and my transition is valid and does not throw any errors.

inputParameters.setComment(defectComment)

 

 

transition.PNG

 

import com.opensymphony.workflow.WorkflowContext
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.event.Event
import java.util.HashMap;
import java.util.List;
import org.ofbiz.core.entity.GenericValue;
import org.ofbiz.core.entity.GenericEntity;
import com.atlassian.jira.event.issue.AbstractIssueEventListener;
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.issue.ModifiedValue;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder;
import com.atlassian.jira.issue.util.IssueChangeHolder;
import org.apache.log4j.Logger
import com.atlassian.jira.component.ComponentAccessor
import org.ofbiz.core.entity.GenericDelegator;
import com.atlassian.jira.issue.changehistory.ChangeHistoryManager;
import com.atlassian.jira.issue.history.ChangeItemBean;
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.changehistory.ChangeHistoryItem
import com.onresolve.scriptrunner.runner.util.UserMessageUtil
import com.atlassian.jira.config.SubTaskManager
import com.atlassian.jira.issue.Issue
import groovy.xml.MarkupBuilder
import com.atlassian.jira.config.properties.APKeys
import com.atlassian.jira.issue.link.LinkCollectionImpl;
import com.atlassian.jira.issue.link.IssueLink;
import com.atlassian.crowd.embedded.api.User;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.link.IssueLinkManager;
import com.atlassian.jira.util.ErrorCollection;
import com.atlassian.jira.util.JiraUtils;
import com.atlassian.jira.workflow.JiraWorkflow;
import com.atlassian.jira.workflow.WorkflowManager;
import com.atlassian.jira.workflow.WorkflowTransitionUtil;
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.workflow.function.issue.AbstractJiraFunctionProvider;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.WorkflowException;
import com.opensymphony.workflow.loader.StepDescriptor;
import com.opensymphony.workflow.spi.SimpleStep;
import com.atlassian.jira.config.ConstantsManager
import com.atlassian.jira.workflow.ImmutableWorkflowDescriptor
import com.atlassian.jira.web.action.admin.workflow.ViewWorkflowStep
import com.opensymphony.workflow.loader.ActionDescriptor
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.bc.issue.IssueService.IssueValidationResult
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.workflow.WorkflowTransitionUtilFactory
import com.atlassian.jira.workflow.TransitionOptions
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.bc.issue.IssueService.IssueResult

def fix =ComponentAccessor.getIssueManager().getIssueByCurrentKey("NATMF-24873")
def defect =ComponentAccessor.getIssueManager().getIssueByCurrentKey("NATMF-24890")


PerformTransition(defect, "1081", fix )


void PerformTransition(Issue linkedissue, String transitionToBeDone, Issue sourceObject) {
def defectComment = "Fix FIXSUMMARY[ISSUEKEY] has been released by USERNAME[USER].";

log.warn("CAM 1 " + transitionToBeDone+" LINKEDISSUE "+linkedissue+" sourceObject "+sourceObject)

IssueService issueService = ComponentAccessor.getIssueService()
log.warn("CAM 1 " + transitionToBeDone)





ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.warn("CAM 2")


log.warn("CAM 3")
int transitionToBeDoneInt = transitionToBeDone as Integer
def constantsManager = ComponentAccessor.getConstantsManager()


log.warn("CAM comment " + defectComment + " summary: " + sourceObject.getSummary())

defectComment = defectComment.replaceAll("FIXSUMMARY", sourceObject.getSummary());
log.warn("CAM comment 2" + defectComment)

defectComment = defectComment.replaceAll("ISSUEKEY", sourceObject.getKey()).replaceAll("USERNAME", currentUser.getDisplayName());
log.warn("CAM comment 3" + defectComment)


defectComment = defectComment.replaceAll("USER", currentUser.getName());
log.warn("CAM comment 4 " + defectComment)

log.warn("CAM comment 5 " + defectComment)

IssueInputParameters inputParameters = issueService.newIssueInputParameters()

IssueInputParameters inputParameters2=inputParameters.setComment(defectComment)

def userManager = ComponentAccessor.userManager
def userKey = "itracfix"
ApplicationUser user=ComponentAccessor.getUserManager().getUserByKey(userKey);
def username=user.getUsername()

IssueService.TransitionValidationResult result = issueService.validateTransition(currentUser,
linkedissue.getId(),
transitionToBeDoneInt,
inputParameters2);

log.warn("CAM 4 " + linkedissue.getKey()+ "=== "+ inputParameters2+"=== "+defectComment+"=== "+inputParameters2.getCommentValue()+"=== "+currentUser)




log.warn("USER NAME MOUNA ")





try {
if (result.isValid()) {
log.warn("CAM 5 " + defectComment+ " "+currentUser+" "+result.getAdditionInputs()+" "+result.getFieldValuesHolder() +" "+result.getErrorCollection() +" "+result.getWarningCollection())

IssueResult issueresult=issueService.transition(currentUser, result)
log.warn("CAM 6 additional input " + result.getAdditionInputs()+" ")
log.warn("CAM 6 getFieldValuesHolder "+result.getFieldValuesHolder() )
log.warn("CAM 6 getErrorCollection " +" "+issueresult.getErrorCollection() )
log.warn("CAM 6 getWarningCollection" +" "+issueresult.getWarningCollection().getWarnings())



}else{
log.warn("CAM 99 " )

}

} catch (Exception e) {
log.warn("CAM 7 " + e)

log.warn(result.getErrorCollection().getErrors());

}

}



///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////


[1]: https://i.stack.imgur.com/VZfwc.png


Here is a copy of my log file where I am printing all the log statements. Anyone knows the problem and what needs to be fixed?

2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM 1 1081 LINKEDISSUE NATMF-24890 sourceObject NATMF-24873
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM 1 1081
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM 2
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM 3
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM comment Fix FIXSUMMARY[ISSUEKEY] has been released by USERNAME[USER]. summary: NDB_8.2_SP8
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM comment 2Fix NDB_8.2_SP8[ISSUEKEY] has been released by USERNAME[USER].
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM comment 3Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[USER].
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM comment 4 Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[mouh].
2022-09-06 16:44:03,539 WARN [runner.ScriptBindingsManager]: CAM comment 5 Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[mouh].
2022-09-06 16:44:03,961 WARN [runner.ScriptBindingsManager]: CAM 4 NATMF-24890=== com.atlassian.jira.issue.IssueInputParametersImpl@7750f7bc=== Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[mouh].=== Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[mouh].=== mouh(JIRAUSER59200)
2022-09-06 16:44:03,961 WARN [runner.ScriptBindingsManager]: USER NAME MOUNA
2022-09-06 16:44:03,961 WARN [runner.ScriptBindingsManager]: CAM 5 Fix NDB_8.2_SP8[NATMF-24873] has been released by Hammoudi, Mouna[mouh]. mouh(JIRAUSER59200) [originalAssigneeId:null, userKey:JIRAUSER59200] [formToken:null] Errors: {}
Error Messages: [] com.atlassian.jira.util.SimpleWarningCollection@1
2022-09-06 16:44:03,977 WARN [listeners.UpdateListener4Features]: Checking issue type: Defect
2022-09-06 16:44:03,977 WARN [log.AutoDefaultsLogger]: Start Auto Defaults Listener
2022-09-06 16:44:03,977 WARN [log.AutoDefaultsLogger]: Issue = NATMF-24890
2022-09-06 16:44:03,977 WARN [log.AutoDefaultsLogger]: End Auto Defaults Listener
2022-09-06 16:44:03,977 WARN [workflow.WorkflowListener]: Start workflow listener
2022-09-06 16:44:03,977 WARN [workflow.WorkflowListenerUtils]: Event type 10022 is skipped
2022-09-06 16:44:03,977 WARN [workflow.WorkflowListenerUtils]: Event requires NO action
2022-09-06 16:44:03,977 WARN [workflow.WorkflowListener]: End workflow listener
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:ISSUE, total primary queue stats: {"maxQueueSize":13,"putCounter":14821,"queueFullOnPut":0,"getCounter":14820,"timeInQueueMillis":{"count":14820,"min":0,"max":172,"sum":4111,"avg":0,"distributionCounter":{"0":14672,"1":1,"10":0,"100":136,"1000":11,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":14820,"min":0,"max":134,"sum":12580,"avg":0,"distributionCounter":{"0":10639,"1":475,"10":3636,"50":64,"100":4,"500":2,"1000":0}},"totalTimeMillis":{"count":14820,"min":0,"max":656,"sum":35901,"avg":2,"distributionCounter":{"0":12931,"1":8,"10":4,"100":1855,"1000":22,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"https-openssl-nio-443-exec-16":914,"https-openssl-nio-443-exec-5":793,"https-openssl-nio-443-exec-13":750,"https-openssl-nio-443-exec-4":730,"https-openssl-nio-443-exec-15":728,"https-openssl-nio-443-exec-18":726,"https-openssl-nio-443-exec-1":679,"https-openssl-nio-443-exec-17":668,"https-openssl-nio-443-exec-10":602,"https-openssl-nio-443-exec-2":595},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:ISSUE, total secondary queue stats: {"maxQueueSize":1,"putCounter":2930,"queueFullOnPut":0,"getCounter":2930,"timeInQueueMillis":{"count":2930,"min":0,"max":31,"sum":282,"avg":0,"distributionCounter":{"0":2913,"1":0,"10":0,"100":17,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":2930,"min":0,"max":188,"sum":886,"avg":0,"distributionCounter":{"0":2353,"1":531,"10":44,"50":1,"100":0,"500":1,"1000":0}},"totalTimeMillis":{"count":2930,"min":0,"max":16006,"sum":263205,"avg":89,"distributionCounter":{"0":107,"1":1,"10":0,"100":2754,"1000":40,"10000":24,"20000":4,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"JiraTaskExecutionThread-1":1405,"JiraTaskExecutionThread-2":1405,"pool-60-thread-1":68,"Caesium-1-3":16,"Caesium-1-1":14,"Caesium-1-4":14,"Caesium-1-2":8},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:ISSUE, snapshot primary queue stats: {"maxQueueSize":1,"putCounter":6,"queueFullOnPut":0,"getCounter":6,"timeInQueueMillis":{"count":6,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":6,"1":0,"10":0,"100":0,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":6,"min":0,"max":3,"sum":8,"avg":1,"distributionCounter":{"0":3,"1":0,"10":3,"50":0,"100":0,"500":0,"1000":0}},"totalTimeMillis":{"count":6,"min":0,"max":16,"sum":32,"avg":5,"distributionCounter":{"0":4,"1":0,"10":0,"100":2,"1000":0,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"https-openssl-nio-443-exec-12":2,"https-openssl-nio-443-exec-15":2,"https-openssl-nio-443-exec-20":1,"https-openssl-nio-443-exec-6":1},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:ISSUE, snapshot secondary queue stats: {"maxQueueSize":0,"putCounter":0,"queueFullOnPut":0,"getCounter":0,"timeInQueueMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":0,"1":0,"10":0,"100":0,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":0,"1":0,"10":0,"50":0,"100":0,"500":0,"1000":0}},"totalTimeMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":0,"1":0,"10":0,"100":0,"1000":0,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:COMMENT, total primary queue stats: {"maxQueueSize":12,"putCounter":3146,"queueFullOnPut":0,"getCounter":3145,"timeInQueueMillis":{"count":3145,"min":0,"max":18,"sum":822,"avg":0,"distributionCounter":{"0":3092,"1":0,"10":0,"100":53,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":3145,"min":0,"max":142,"sum":10513,"avg":3,"distributionCounter":{"0":549,"1":1047,"10":1360,"50":184,"100":3,"500":2,"1000":0}},"totalTimeMillis":{"count":3145,"min":0,"max":656,"sum":19379,"avg":6,"distributionCounter":{"0":2149,"1":0,"10":1,"100":989,"1000":6,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"https-openssl-nio-443-exec-2":207,"https-openssl-nio-443-exec-25":143,"https-openssl-nio-443-exec-1":139,"https-openssl-nio-443-exec-23":126,"https-openssl-nio-443-exec-15":123,"https-openssl-nio-443-exec-3":114,"https-openssl-nio-443-exec-7":113,"https-openssl-nio-443-exec-17":112,"https-openssl-nio-443-exec-6":112,"https-openssl-nio-443-exec-10":110},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:COMMENT, total secondary queue stats: {"maxQueueSize":9,"putCounter":101164,"queueFullOnPut":0,"getCounter":101164,"timeInQueueMillis":{"count":101164,"min":0,"max":62,"sum":5952,"avg":0,"distributionCounter":{"0":100794,"1":4,"10":1,"100":365,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":101164,"min":0,"max":165,"sum":2415,"avg":0,"distributionCounter":{"0":100043,"1":686,"10":407,"50":26,"100":1,"500":1,"1000":0}},"totalTimeMillis":{"count":101164,"min":0,"max":391,"sum":402127,"avg":3,"distributionCounter":{"0":77786,"1":47,"10":70,"100":23253,"1000":8,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"NodeReindexServiceThread:thread-0":101095,"pool-60-thread-1":17,"Caesium-1-3":16,"Caesium-1-1":14,"Caesium-1-4":14,"Caesium-1-2":8},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:COMMENT, snapshot primary queue stats: {"maxQueueSize":1,"putCounter":3,"queueFullOnPut":0,"getCounter":3,"timeInQueueMillis":{"count":3,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":3,"1":0,"10":0,"100":0,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":3,"min":2,"max":2,"sum":6,"avg":2,"distributionCounter":{"0":0,"1":0,"10":3,"50":0,"100":0,"500":0,"1000":0}},"totalTimeMillis":{"count":3,"min":0,"max":16,"sum":16,"avg":5,"distributionCounter":{"0":2,"1":0,"10":0,"100":1,"1000":0,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"https-openssl-nio-443-exec-12":1,"https-openssl-nio-443-exec-15":1,"https-openssl-nio-443-exec-20":1},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:COMMENT, snapshot secondary queue stats: {"maxQueueSize":1,"putCounter":144,"queueFullOnPut":0,"getCounter":144,"timeInQueueMillis":{"count":144,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"0":144,"1":0,"10":0,"100":0,"1000":0,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":144,"min":0,"max":1,"sum":3,"avg":0,"distributionCounter":{"0":141,"1":3,"10":0,"50":0,"100":0,"500":0,"1000":0}},"totalTimeMillis":{"count":144,"min":0,"max":16,"sum":405,"avg":2,"distributionCounter":{"0":118,"1":0,"10":0,"100":26,"1000":0,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"NodeReindexServiceThread:thread-0":144},"indexerNotRunningCounter":0}
2022-09-06 16:44:04,305 INFO [index.QueueingIndexStats]: [JIRA-STATS] [INDEXING-QUEUE] index:CHANGE_HISTORY, total primary queue stats: {"maxQueueSize":11,"putCounter":14821,"queueFullOnPut":0,"getCounter":14820,"timeInQueueMillis":{"count":14820,"min":0,"max":125,"sum":1822,"avg":0,"distributionCounter":{"0":14708,"1":2,"10":0,"100":109,"1000":1,"10000":0,"20000":0,"30000":0}},"timeToUpdateIndexMillis":{"count":14820,"min":0,"max":33,"sum":9668,"avg":0,"distributionCounter":{"0":10451,"1":1696,"10":2639,"50":34,"100":0,"500":0,"1000":0}},"totalTimeMillis":{"count":14820,"min":0,"max":494,"sum":39214,"avg":2,"distributionCounter":{"0":12660,"1":8,"10":4,"100":2132,"1000":16,"10000":0,"20000":0,"30000":0}},"totalTimeFailedMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"totalTimeTimedOutMillis":{"count":0,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{}},"putCounterByThreadTopN":{"https-openssl-nio-443-exec-16":914,"https-openssl-nio-443-exec-5":793,"https-openssl-nio-443-exec-13":750,"https-openssl-nio-443-exec-4":730,"https-openssl-nio-443-exec-15":728,"https-openssl-nio-443-exec-18":726,"https-openssl-nio-443-exec-1":679,"https-openssl-nio-443-exec-17":668,"https-openssl-nio-443-exec-10":602,"https-openssl-nio-443-exec-2":595},"indexerNotRunningCounter":0}

2022-09-06 16:44:04,430 INFO [stats.TotalAndSnapshotIndexSearcherStats]: [JIRA-STATS] [index-searcher-stats] ISSUE : snapshot stats: {"searchStatsInMillis":{"count":230,"min":0,"max":26,"sum":367,"avg":1,"distributionCounter":{"1":197,"10":21,"20":9,"50":3,"100":0,"500":0,"1000":0,"5000":0}},"docStatsInMillis":{"count":3,"min":0,"max":0,"sum":0,"avg":0,"distributionCounter":{"1":3,"10":0,"20":0,"50":0,"100":0,"500":0,"1000":0,"5000":0}},"getSearcherTotalStatsInMillis":{"count":3,"min":35,"max":42,"sum":115,"avg":38,"distributionCounter":{"1":0,"10":0,"20":0,"50":3,"100":0,"500":0,"1000":0,"5000":0}},"getNewSearcherStatsInMillis":{"count":3,"min":35,"max":42,"sum":115,"avg":38,"distributionCounter":{"1":0,"10":0,"20":0,"50":3,"100":0,"500":0,"1000":0,"5000":0}}}
2022-09-06 16:44:04,430 WARN [runner.ScriptBindingsManager]: CAM 6 additional input [originalAssigneeId:null, userKey:JIRAUSER59200]
2022-09-06 16:44:04,430 WARN [runner.ScriptBindingsManager]: CAM 6 getFieldValuesHolder [formToken:null]
2022-09-06 16:44:04,430 WARN [runner.ScriptBindingsManager]: CAM 6 getErrorCollection Errors: {}
Error Messages: []
2022-09-06 16:44:04,430 WARN [runner.ScriptBindingsManager]: CAM 6 getWarningCollection []

 

1 answer

0 votes

Hi @Mouna Hammoudi ,

in order to manage comment within an issue you should use https://docs.atlassian.com/software/jira/docs/api/8.0.0/index.html?com/atlassian/jira/issue/comments/CommentManager.html

Hope this helps,

Fabio

I do not want to use the commentManager, the code that I have should already be doing the job, I have written thefollowing  lines of code and I am setting the comment for the transition, this should be enough and it should work this way. I don't want to use the CommentManager. 

 

IssueInputParameters inputParameters2=inputParameters.setComment(defectComment)

 

IssueService.TransitionValidationResult result = issueService.validateTransition(currentUser,
linkedissue.getId(),
transitionToBeDoneInt,
inputParameters2);

if (result.isValid()) {
log.warn("CAM 5 " + defectComment+ " "+currentUser+" "+result.getAdditionInputs()+" "+result.getFieldValuesHolder() +" "+result.getErrorCollection() +" "+result.getWarningCollection())

IssueResult issueresult=issueService.transition(currentUser, result)
log.warn("CAM 6 additional input " + result.getAdditionInputs()+" ")
log.warn("CAM 6 getFieldValuesHolder "+result.getFieldValuesHolder() )
log.warn("CAM 6 getErrorCollection " +" "+issueresult.getErrorCollection() )
log.warn("CAM 6 getWarningCollection" +" "+issueresult.getWarningCollection().getWarnings())



}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events