feat: Add user attribution to Linear integration with actor authorization (#11774)
- Add `actor=app` parameter to Linear OAuth authorization URL for consistent app-level authorization https://linear.app/developers/oauth-actor-authorization - Implement user attribution for Linear issue creation and linking using `createAsUser` and `displayIconUrl` parameters - Enhance Linear integration to properly attribute actions to specific Chatwoot agents **Note** - The displayIconUrl parameter is being sent correctly to Linear's GraphQL API (verified through testing), but there is an issues with icon is not attaching properly. - We might need to disconnect the integration connect again.
This commit is contained in:
@@ -32,10 +32,22 @@ module Linear::Mutations
|
||||
GRAPHQL
|
||||
end
|
||||
|
||||
def self.issue_link(issue_id, link, title)
|
||||
def self.issue_link(params)
|
||||
issue_id = params[:issue_id]
|
||||
link = params[:link]
|
||||
title = params[:title]
|
||||
user_name = params[:user_name]
|
||||
user_avatar_url = params[:user_avatar_url]
|
||||
|
||||
user_params = []
|
||||
user_params << "createAsUser: #{graphql_value(user_name)}" if user_name.present?
|
||||
user_params << "displayIconUrl: #{graphql_value(user_avatar_url)}" if user_avatar_url.present?
|
||||
|
||||
user_params_str = user_params.any? ? ", #{user_params.join(', ')}" : ''
|
||||
|
||||
<<~GRAPHQL
|
||||
mutation {
|
||||
attachmentLinkURL(url: "#{link}", issueId: "#{issue_id}", title: "#{title}") {
|
||||
attachmentLinkURL(url: "#{link}", issueId: "#{issue_id}", title: "#{title}"#{user_params_str}) {
|
||||
success
|
||||
attachment {
|
||||
id
|
||||
|
||||
Reference in New Issue
Block a user