API closes_issues endpoint fails when referencing external issues
View options
- Truncate descriptions
From ZenDesk: https://gitlab.zendesk.com/agent/tickets/26174
We have identified an issue with the merge request API.
Steps to reproduce it:
- To have a GitLab project where JIRA service is active
- To have a merge request in which description we include "Closes ABC-XXXX"
- From the API: curl -H "PRIVATE-TOKEN: xxxxxxx"
https://gitlab.example.com/api/v3/projects/XXX/merge_requests/YYY/closes_issues
It is expected the description of ABC-XXXX
However, it returns:
{"message":"500 Internal Server Error"}
In the server side, we see:
NoMethodError (API::Entities::Issue missing attribute `description' on
ABC-XXXX):
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:605:in
`valid_exposure?'
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:551:in
`value_for'
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:442:in
`block in serializable_hash'
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:439:in
`each'
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:439:in
`each_with_object'
/var/lib/git/gitlab/vendor/bundle/ruby/gems/grape-entity-0.4.8/lib/grape_entity/entity.rb:439:in
`serializable_hash'
When using GitLab built-in issue tracker, this end-point works as expected.
Do you manage to reproduce the problem?
It looks like that ProjectEntity
expects every issue to have a description
:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/entities.rb#L157
Descriptions do not exist for external issues.
- Show labels
- Show closed items
Link items together to show that they're related or that one is blocking others.