Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AsanaGetReleaseAutomationSubtaskIdAction #1

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

ayoy
Copy link
Contributor

@ayoy ayoy commented Aug 30, 2024

Task/Issue URL: https://app.asana.com/0/0/1208137627434493/f

Description:
This change adds new action that replaces asana-get-automation-subtask-id action.

Comment on lines 29 to 32
automation_subtask_id = data
.find_all { |hash| hash['name'] == 'Automation' }
&.min_by { |x| Time.parse(x['created_at']) } # Get the oldest 'Automation' subtask
&.dig('gid')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it makes sense to put into a separate private method, like so:

def self.find_oldest_automation_subtask(data)
data
.select { |hash| hash['name'] == 'Automation' }
&.min_by { |x| Time.parse(x['created_at']) }
&.dig('gid')
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor

@jaceklyp jaceklyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ;)

@ayoy ayoy merged commit 9365686 into main Sep 2, 2024
1 check passed
@ayoy ayoy deleted the dominik/asana-get-automation-subtask-id branch September 2, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants