6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/linear/commands/add_comment.rb', line 6
def (issue_id, body, client: Client.new)
issue_result = client.query(Queries::ISSUE, { id: issue_id })
issue = issue_result.dig("data", "issue")
unless issue
puts "Error: Issue not found: #{issue_id}"
return
end
result = client.query(Queries::, {
issueId: issue['id'],
body: body
})
if result.dig("data", "commentCreate", "success")
puts "Comment added to #{issue_id}"
else
puts "Error: Failed to add comment"
end
end
|