Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
4.2, 5.2.5, 6.3.15
-
Linux standalone
-
4.02
-
2
-
Severity 3 - Minor
-
1
-
Description
Summary
IssueInputParameters doesn't create a comment during transition or adds a duplicate comment when the transition has a screen
Steps to Reproduce
Try to add a comment to an issue programatically using IssueInputParameters.setComment() during a transition having no transition screen. For example, I've created a Groovy script that I run via ScriptRunner. This script runs in a post function. In the script, I'm setting a transition comment. Here is the relevant section of the code I'm executing:
final String SYSTEM_USER = "system"; User systemUser = ComponentManager.getInstance().getUserUtil().getUser(SYSTEM_USER); ... IssueInputParameters issueInputParameters = new IssueInputParametersImpl(); // comment not showing up issueInputParameters.setComment("All issues depended on are either resolved or closed."); TransitionValidationResult transitionValidationResult = issueService.validateTransition(systemUser, linkedIssue.getId(), ALL_WAITING_ISSUES_RESOLVED_ACTION_ID, issueInputParameters); if (transitionValidationResult.isValid()) { IssueResult transitionResult = issueService.transition(systemUser, transitionValidationResult); if (transitionResult.isValid()) { log.debug("Issue " + linkedIssue + " successfully transitioned out of WAITING ISSUE status"); // See above, comment submitted with transition is not showing up, so we add one ourselves. linkedIssue = issueManager.getIssueObject(linkedIssue.getKey()); commentManager.create(linkedIssue, SYSTEM_USER, "All issues depended on are either resolved or closed.", true); } else { log.debug("Issue " + linkedIssue + " transitionResult not valid"); } } else { log.debug("Issue " + linkedIssue + " transitionValidationResult not valid"); } }
Expected results
Comment is added to issue along with other fields.
Actual results
- Comment is not getting added to the issue for transitions that have no screen. I then separately add the comment using the same user account, and that is successfully added to the issue.
- When there is actually a transition screen and skipScreenCheck is set to true on the IssueInputParameters, duplicate comments get added.
Attachments
Issue Links
- is related to
-
JRASERVER-65583 setSkipScreenCheck is required to update fields on non-default tabs
- Closed
- relates to
-
JRASERVER-60833 validateTransition in IssueService API does not allow for validation of actions(transitions) with no view(screen) attached
- Gathering Impact