Skip to content

[JENKINS-65496] Huge JIRA comments generated by "Update relevant issues" are silently rejected. #667

Description

@rantoniuk

A big merge or a change involving lots of files easily produces a huge comment, especially when "Record Scm changes" is turned on. 
Jira typically has a limit on the comment size, and when Jenkins attempts to put in such a huge comment, the updater fails as below:

2021-04-23 10:43:26.704+0000 [id=21943]	WARNING	h.plugins.jira.JiraRestService#addComment: Jira REST client add comment error. cause: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={comment=The entered text is too long. It exceeds the allowed limit of 32767 characters.}, errorMessages=[]}]}
RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={comment=The entered text is too long. It exceeds the allowed limit of 32767 characters.}, errorMessages=[]}]}
	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:176)
	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:170)

These JIRA update failures are not reflected in the job console log (it only puts out several [Jira] Updating issue KEY-1234 ), so there's no way to tell what went wrong unless you look up the actual Jenkins log.

EXPECTED:
1. report JIRA update failures in the job console log
2. add a parameter ("max. comment length" or whatever) in the global configuration for the Jira plugin. Truncate generated comments according to this limit (possibly, attempting to close any fancy formatting tags at the end, but that's not critical).

It's also quite possible that one may need to see the SCM details fetched by "record SCM changes" in Jenkins' web UI, but omit them in the JIRA comments. I do not see how to achieve this having only a single checkbox in the Configuration.


Originally reported by vicd, imported from: Huge JIRA comments generated by "Update relevant issues" are silently rejected.
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2025-05-30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions