The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I need to set the issue key argument here. How do I fetch the issue key from the code.
We can't answer that question because it has no context.
You'll need to explain what issue you are looking for and how you want to identify it. User types it in? Searches? Are you in Jira or another system when you need to identify it? If it's outside Jira, how does that system know which issue it should be looking at?