0

how can I pass Jira Ticket-ID as a command-line argument to the ruby script? I'm using Jira-ruby gem. I have a script in which I have to find a particular Jira ticket and comment on it. I want to pass that ticket from the command line to the ruby script. Thanks in advance

jira_client.Issue.find("ID-10389")
    comment = issue.comments.build
    comment.save!(:body => "New comment from example script")`
end
1

1 Answer 1

0

You can use ARGV that contains all string passed as an argument to the command line.

You may try something like this using a splat operator: id, *the_rest = ARGV. Then you can use the local variable id to call the jira_client.Issue.find method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.