Showing posts with label Read. Show all posts
Showing posts with label Read. Show all posts

April 20, 2026

Authenticating with Jira Cloud APIs to Create and Fetch Issues

🚀 End-to-End Guide: Authenticating with Jira Cloud APIs to Create and Fetch Issues

Integrating with Jira Cloud programmatically is a common requirement for automation, testing, and DevOps workflows. This guide walks through the complete authentication flow using OAuth (client credentials) and demonstrates how to fetch and create Jira issues using REST APIs.

This approach is designed for non-interactive service integrations, meaning no UI login is required.


🔐 Overview of the Flow

At a high level, interacting with Jira APIs involves four key steps:

  1. Generate an access token
  2. Discover accessible resources (Cloud ID)
  3. Fetch existing issues
  4. Create new issues

Each step builds on the previous one.


1️⃣ Generate an Access Token

Authentication begins by exchanging your client credentials for an access token.

Pre-requisites

  1. Create a service user in Atlassian Jira directory.
  2. Create an OAuth 2.0 credentials to get the Client ID and Client Credentials.

Request

POST https://auth.atlassian.com/oauth/token
Content-Type: application/json

Body

{
  "grant_type": "client_credentials",
  "client_id": "{{CLIENT_ID}}",
  "client_secret": "{{CLIENT_SECRET}}",
  "audience": "api.atlassian.com"
}

This returns a response containing:

{
  "access_token": "your_token_here",
  "expires_in": 3600
}



You’ll use this access_token for all subsequent API calls.  


2️⃣ Retrieve Cloud ID (Accessible Resources)

Jira APIs require a Cloud ID, which identifies the Jira instance associated with your token.

Request

GET https://api.atlassian.com/oauth/token/accessible-resources
Authorization: Bearer {{ACCESS_TOKEN}}
Accept: application/json

Response

[
  {
    "id": "cloud-id",
    "url": "https://your-instance.atlassian.net"
  }
]
  • id → used as cloudId
  • url → base Jira site URL



This step is essential because all Jira API calls must go through the API gateway using the Cloud ID.  


3️⃣ Fetch a Jira Issue

Once authenticated, you can retrieve issue details.

Request

GET https://api.atlassian.com/ex/jira/{{CLOUD_ID}}/rest/api/3/issue/{{PROJECT_KEY}}-1
Authorization: Bearer {{ACCESS_TOKEN}}
Accept: application/json

What this does

  • Uses the API gateway (api.atlassian.com)
  • Authenticates with Bearer token
  • Fetches a specific issue using its key



This endpoint returns full issue details including summary, status, and metadata.  


4️⃣ Create a Jira Issue

Creating issues programmatically is one of the most common use cases.

Request

POST https://api.atlassian.com/ex/jira/{{CLOUD_ID}}/rest/api/3/issue
Authorization: Bearer {{ACCESS_TOKEN}}
Accept: application/json
Content-Type: application/json

Body

{
  "fields": {
    "project": {
      "key": "{{PROJECT_KEY}}"
    },
    "summary": "Bug created from API",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Created via API using OAuth token"
            }
          ]
        }
      ]
    },
    "issuetype": {
      "name": "Bug"
    }
  }
}

Important Notes

  • Description must use Atlassian Document Format (ADF) — plain text is not accepted.
  • project.key must exist in your Jira instance.
  • issuetype.name must be valid (e.g., Bug, Task, Story).



This request creates a new issue and returns its ID and key.  


🔁 Automating the Flow

In tools like Bruno or Postman, you can automate this workflow:

  • Store access_token after token request
  • Extract cloudId dynamically
  • Reuse both in subsequent requests

Example script:

const body = bru.response.json();
bru.setEnvVar("ACCESS_TOKEN", body.access_token);

⚠️ Common Pitfalls

❌ Using the wrong base URL

  • Don’t use: https://your-domain.atlassian.net/rest/api/...
  • Use: https://api.atlassian.com/ex/jira/{cloudId}/...

❌ Missing permissions

  • The service account must have:
    • Browse Projects
    • Create Issues (for POST)

❌ Invalid payload

  • Missing required fields → 400 error
  • Wrong issue type → validation failure

❌ Expired token

  • Tokens expire (usually in 1 hour)
  • Regenerate as needed

🧩 Putting It All Together

Here’s the complete sequence:

  1. 🔑 Get access token
  2. 🌐 Get Cloud ID
  3. 📥 Fetch issue
  4. 📤 Create issue

This workflow enables full read/write automation with Jira Cloud APIs.


🏁 Conclusion

Using OAuth with client credentials provides a secure and scalable way to interact with Jira Cloud APIs without relying on user login or UI access.

With just a few API calls, you can:

  • integrate Jira into CI/CD pipelines
  • automate bug creation
  • build dashboards or monitoring tools

Once set up, this becomes a powerful foundation for any Jira-based automation.


Please feel free to reachout psrdotcom@gmail.com for any feedback and suggestions.

December 08, 2014

Adding Company (Exchange) e-Mail account in Android Lollipop

Hi friends,

Today I’ll be explaining the steps involved in adding an e-mail account in Android 5/L (Lollipop)

Procedure

  1. To add acount, you can follow any one of the following approaches
    • Click on “eMail”->Settings->”Add Account”
    • Select “Settings”->”Accounts”->”Add Account”
  2. Select “Exchange”
  3. Click “OK”
  4. Enter the e-mail address
  5. Click “Next”
  6. Enter your password details
  7. Browse the certificate if you have your company e-mail certificate
  8. Click “Next”
  9. Enter username as “domainname\userno” if it’s applicable for your company or else it will be your e-mail address itselft which is by default filled in.
    • Ex: lnties\XXXXXX
  10. Change server to your mail server
    • Ex: “mail.larsentoubro.com”
  11. Click “Next”
  12. Select the sync options
  13. Click “Finish”

Now the sync process will start and fetch your mails.

You can change the sync options in settings

Happy e-mailing guys Smile

Please send your feedback and comments to psrdotcom@gmail.com

Blogger Labels: Company,Exchange,Mail,account,Android,Lollipop,Procedure,Click,Settings,Select,Accounts,Enter,password,Browse,certificate,XXXXXX,Change,server,options,Finish,feedback,sync

November 22, 2012

Mount TrueCrypt Volume with Read and Write File Permission for Users and Groups

Hi friends,

I have been working on Ubuntu from a long time. Recently I am exploring on TrueCrypt and I faced the following issue. After searching lot of websites and forums, I made a solution which worked for me perfectly.

Objective:
TrueCrypt volume copied data should be available to all when its mounted.

Usual Procedure:
Mount the TrueCrypt volume in Ubuntu
Copy some data to the volume
Change file permissions to other users or groups
Other users should be able to view the data from the volume when mounted

Hiccup(Problem):
After mounting the TrueCrypt Volume the directory permissions are changed and fixed to 700 (rwx --- ---). i.e. No access to groups and others.
Changing the directory permissions and changing the ownership will not be applied.
So, other groups and others cannot access the data.

Solution:
While mouting the TrueCrypt volume we need to specify the file system type and give permission to user[s] and/or group[s] with umask.

Please find the syntax and example below

Syntax:
$sudo /usr/bin/truecrypt -t --filesystem={filesystem_type} --fs-options={rwx},uid={userid},gid={groupid},umask={ugorwx} {your_tc_volume} {mounting_folder}

Example:
$sudo /usr/bin/truecrypt -t --filesystem=vfat --fs-options=rw,uid=1000,gid=1000,umask=022 tc1.tc /mnt/folder1

Thanks for visiting my blog.

Please send your feedback and comments to psrdotcom@gmail.com

January 20, 2012

Protect Your USB Pen drive by making it Write Protect / Read Only Device in Windows from Viruses

Hi friends,

Today I have come across protecting the USB pen drive from viruses.

I found lot of useful stuff from internet. I just want to share my views on USB Pen drive protection

There are several to protect your pen drive from viruses. I found the following ways are useful.

Make the USB Pen drive Read-only or Writable:
  1. Installing a software which provides options
  2. Running the .reg files to edit the registry automatically
  3. Manually editing registry
1. Installing a software which provides options
Thumbscrew is a software which makes the drive read-only or writable with single click.

Please find the source of the Thumbscrew software from this link
http://www.irongeek.com/i.php?page=security/thumbscrew-software-usb-write-blocker&mode=print

The installation and usage of the Thumbscrew software are described in this blog
http://editecforum.blogspot.com/2008/06/make-your-usb-read-only-while-putting.html

2. Running the .reg files to edit the registry automatically
Download the .reg files from this link
http://www.shaplus.com/exes/guide/EnableOrDisableUSBWrite.zip

When you want to make device read-only then please run the EnableUSBWrite.reg and connect the device
When you want to make device writable then please run the DisableUSBWrite.reg and copy the content

For further more information on these .reg files, please visit their link
http://www.shaplus.com/guide/Computer_Internet/write-protect-usb-flash-drive.htm

Note: You can view the .reg file content by opening the file in notepad or any other text editor

3. Manually editing registry
If you want to do it manually to see how it will work, then you can do that also by following this procedure
http://blog.ashfame.com/2008/04/write-protect-usb-thumb-pen-drive/




Make your USB Pen drive a bit faster
By following this procedure you can make your pen drive to work faster compared to previous
http://www.labofweb.com/how-to-protect-pendrive-from-virus-prevent-the-entry-of-virus-to-your-usb-drive-and-increase-its-speed-of-perfomance-by-formating-it-in-ntfs-file-system-and-making-as-read-only/

Protect your pen drives from viruses
Block all the executable files from your pen drive from running virus
http://www.techtola.com/2008/01/ways-to-prevent-70-virus-malware.html

December 17, 2011

Write in Telugu in your computer, website, blog for e-readers and e-writers

Hi Telugu e-writers,

I found something very interesting for you in Hyderabad Book Fair 2011.

There are some stalls for Telugu language where they are offering us to read, write in Telugu in our computer.

Please visit  http://etelugu.org/ link to use the computer in Telugu language.

If you are interested to write in Telugu http://etelugu.org/typing-telugu

Debian Operating System is customized with Telugu font and all the menus and typing has been done in Telugu.The Operating System CD costs Rs. 100/-

References:
http://etelugu.org/
http://etelugu.org/typing-telugu
http://telugublog.blogspot.com/2006/03/xp.html

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com