Skip to content

Commit

Permalink
fix: case insensitive sub-task comparison
Browse files Browse the repository at this point in the history
Within my cloud installation, the jira init command pulls the handle and name just fine but my administrator configured the name as "Sub-task" and the handle as "Sub-Task" which fails the equal check and causes failures with the parent key assignment. This PR addresses this by using an EqualFold so case insensitive matching is done for the issue type check.
  • Loading branch information
tiemma committed Nov 5, 2024
1 parent 3422178 commit 0e0025f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/jira/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (*Client) getRequestData(req *CreateRequest) *createRequest {
subtaskField = req.SubtaskField
}

if req.projectType == ProjectTypeNextGen || data.Fields.M.IssueType.Name == subtaskField {
if req.projectType == ProjectTypeNextGen || strings.EqualFold(data.Fields.M.IssueType.Name, subtaskField) {
data.Fields.M.Parent = &struct {
Key string `json:"key"`
}{Key: req.ParentIssueKey}
Expand Down

0 comments on commit 0e0025f

Please sign in to comment.