Swati, it looks like you question has been discussed in a previous post. Check this discussion out.
Hope it helps!
do you know this tutorial? https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/
there are examples in multiple programming languages, so it might help you too:
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot