drone / drone-jira

Drone plugin for sending build and deployment status updates to Jira
Other
7 stars 19 forks source link

Update Instance Handling to Extract Instance Name from Full URL #22

Closed Ompragash closed 1 day ago

Ompragash commented 1 month ago

Description:

This enhancement proposes updating the Instance parameter so that users can pass either the full Jira instance URL (e.g., fossops.atlassian.net) or just the instance name (e.g., fossops). The plugin will automatically extract the instance name from the full URL when provided.

Problem:

Currently, the Instance parameter only accepts the Jira instance name (e.g., fossops). However, users may pass the full instance URL (e.g., fossops.atlassian.net). The plugin needs to handle this gracefully by extracting the instance name from the full URL and using it in the rest of the plugin logic.

Solution:

Enhance the plugin to check if the Instance is passed as a full URL (ending with .atlassian.net). If so, extract the instance name from the URL and use it.

Example Usage:

  1. Passing Full Jira Instance URL: Users can pass the full Jira instance URL in the configuration:

    - name: deployment
    image: your-plugin-image
    settings:
    instance: fossops.atlassian.net
    cloud_id: your-cloud-id
    client_id: your-client-id
    client_secret: your-client-secret
    project: SCRUM
    issuekeys:
      - SCRUM-1
      - SCRUM-2

    In this case, the plugin will extract fossops from the URL and use it for internal logic.

  2. Passing Instance Name Only: If the user passes just the instance name (fossops), the behavior remains the same:

    - name: deployment
    image: your-plugin-image
    settings:
    instance: fossops
    cloud_id: your-cloud-id
    client_id: your-client-id
    client_secret: your-client-secret
    project: SCRUM
    issuekeys:
      - SCRUM-1
      - SCRUM-2
Ompragash commented 1 day ago

Added in #26