Building Custom IssueOps

Create custom IssueOps by building GitHub Actions workflows that respond to issues with structured data. No modifications to sfp required.

How It Works

  1. User creates an issue with JSON payload (via DevCentral form or directly)

  2. GitHub Actions workflow triggers on issue events

  3. Workflow parses the JSON and executes custom logic

  4. Workflow posts updates back to the issue

DevCentral Integration

Custom IssueOps can integrate with DevCentral in two ways:

For Built-in IssueOps: DevCentral automatically displays forms for standard operations (scratch orgs, packages, etc.) in the Service Catalogue.

For Custom IssueOps: Add form definitions to your DevCentral repository's _forms directory. These will appear in the Service Catalogue, allowing users to submit requests through a user-friendly interface instead of writing JSON.

Complete Example: Custom Deployment Workflow

Here's a working example of a custom IssueOps that deploys to an environment.

Note: This example shows how to create a completely custom IssueOps workflow. For standard operations like scratch org requests or package installations, use the built-in IssueOps provided by sfops.

1. Create the Issue Form (Optional)

For user-friendly forms, add this file to your DevCentral repository's _forms/custom-deploy.yml:

2. Create the Workflow

Add this file to .github/workflows/custom-deploy.yml:

3. How Users Submit Requests

Users can submit requests in two ways:

Option A: Through DevCentral Forms Navigate to DevCentral's Service Catalogue and fill out the form.

Option B: Direct Issue Creation Create an issue directly in GitHub with JSON in the body:

The workflow detects this JSON and processes the request.

Key Concepts

Parsing JSON from Issues

Validating Requests

Always validate:

  • Required fields are present

  • Values are in expected format

  • User has necessary permissions

Providing Feedback

Use issue comments to:

  • Confirm request received

  • Show progress updates

  • Report success or failure

  • Provide next steps

Handling Errors

  • Post clear error messages

  • Include links to logs

  • Suggest fixes

  • Don't expose sensitive information

Extending Your Custom IssueOps

Add Approval Requirements

Check if certain users or teams approved:

Integrate with External Systems

Call webhooks or APIs:

Chain with Built-in IssueOps

React to completed built-in IssueOps:

Best Practices

  1. Keep it Simple: Start with basic functionality, add complexity as needed

  2. Validate Everything: Check inputs before processing

  3. Provide Clear Feedback: Users should know what's happening

  4. Handle Errors Gracefully: Anticipate failures and provide helpful messages

  5. Use Secrets: Never hardcode sensitive data

  6. Test Thoroughly: Create test issues to verify workflow behavior

Testing Your Custom IssueOps

  1. Create a test issue with your JSON payload

  2. Watch the Actions tab for workflow execution

  3. Verify comments are posted correctly

  4. Confirm the operation completed as expected

Troubleshooting

Workflow not triggering:

  • Check the if condition matches your JSON

  • Verify workflow file is in correct location

  • Ensure workflow has necessary permissions

JSON parsing errors:

  • Validate JSON syntax

  • Check for special characters that need escaping

  • Ensure JSON is within HTML comment tags

Operations failing:

  • Review workflow logs in Actions tab

  • Check required secrets are configured

  • Verify permissions for resources being accessed

Next Steps

  • Customize the example for your needs

  • Add additional validation logic

  • Integrate with your existing CI/CD pipeline

  • Share your custom IssueOps with your team

Last updated