keep icon indicating copy to clipboard operation
keep copied to clipboard

[🔌 Provider]: ServiceNow pull activity from incidents into incidents

Open talboren opened this issue 10 months ago • 13 comments

As a user, I would like to pull activity from ServiceNow incident into my Keep incident and the other way around.

talboren avatar Feb 10 '25 13:02 talboren

/bounty 30

Matvey-Kuk avatar Feb 14 '25 00:02 Matvey-Kuk

💎 $30 bounty • Keep (YC W23)

Steps to solve:

  1. Start working: Comment /attempt #3379 with your implementation plan
  2. Submit work: Create a pull request including /claim #3379 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to keephq/keep!

Attempt Started (UTC) Solution Actions
🟢 @Abhishek-Atole Apr 06, 2025, 04:03:45 PM #4437 Reward
🔴 @Shashwat-srivastav Feb 15, 2025, 12:10:39 PM WIP
🟢 @MayorChristopher Mar 31, 2025, 10:05:44 PM WIP

algora-pbc[bot] avatar Feb 14 '25 00:02 algora-pbc[bot]

/attempt #3379

Options

Shashwat-srivastav avatar Feb 15 '25 07:02 Shashwat-srivastav

would you please provide me with more details on this

Shashwat-srivastav avatar Feb 15 '25 07:02 Shashwat-srivastav

@Shashwat-srivastav that's about pulling SNOW's incident activities to Keep as keep's activities. Are you familiar with the SNOW?

Matvey-Kuk avatar Feb 18 '25 09:02 Matvey-Kuk

Assigned btw!

Matvey-Kuk avatar Feb 18 '25 09:02 Matvey-Kuk

thank you SNOW is related to ServiceNow tracking activities like managing and reporting incidents I think is this correct?

Shashwat-srivastav avatar Feb 18 '25 09:02 Shashwat-srivastav

That's correct, thank you @Shashwat-srivastav

Matvey-Kuk avatar Feb 20 '25 14:02 Matvey-Kuk

@Matvey-Kuk these are the changes i did locally so If this is what required I will push this

Files Modified:

keep/providers/servicenow_provider/servicenow_provider.py

  • Added get_incident_activities() method to fetch activity entries from ServiceNow incidents
  • Added post_incident_activity() method to push Keep updates to ServiceNow
  • Enhanced _query() method to support POST requests and parameterized queries

keep/workflows/servicenow_sync_workflow.py

  • Implemented ServiceNowSyncWorkflow class for bidirectional sync
  • Added activity synchronization logic with conflict resolution

keep/workflows/configs/servicenow_sync.yaml

  • Created workflow configuration for scheduled/webhook sync

New Files:

keep/workflows/configs/servicenow_sync_config.py

  • Added configuration model for sync settings

tests/providers/test_servicenow_sync.py

  • Added unit tests for sync functionality

docs/providers/servicenow.md

  • Updated documentation with sync features

keep/observability/dashboards/servicenow_sync.json

  • Added monitoring dashboard

keep/compliance/servicenow_controls.py

  • Added compliance validation

keep/audit/servicenow_logger.py

  • Implemented audit logging

Shashwat-srivastav avatar Feb 23 '25 12:02 Shashwat-srivastav

ServiceNow Integration Changes

Code Changes

keep/providers/servicenow_provider/servicenow_provider.py

  • Added get_incident_activities() method
    • Implements activity fetch from sys_journal_field
    • Handles pagination and incident ID filtering
  • Added post_incident_activity() method
    • Posts Keep updates to ServiceNow with [Keep Update] prefix
    • Formats payload per ServiceNow API specs
  • Enhanced _query() method
    • Added support for multiple HTTP methods
    • Implemented parameterized requests
    • Improved error handling

keep/workflows/servicenow_sync_workflow.py

  • Implemented ServiceNowSyncWorkflow class with:
    • Bidirectional sync using timestamp-based conflict resolution
    • Configurable batch processing
    • Automatic retry mechanism
    • Periodic scheduling support

keep/workflows/configs/servicenow_sync.yaml

  • Configuration updates:
    • 15-minute sync schedule
    • Webhook trigger support
    • 3-retry error handling
    • Alert integration for sync failures

keep/workflows/configs/servicenow_sync_config.py

  • New ServiceNowSyncConfig class managing:
    • API rate limiting
    • Activity batch sizes
    • Historical sync window
    • Conflict resolution strategies

Testing & Documentation

tests/providers/test_servicenow_sync.py

  • Added comprehensive test suite:
    • Bidirectional sync scenarios
    • API error handling
    • Conflict resolution
    • Performance benchmarks

docs/providers/servicenow.md

  • Documentation for:
    • Real-time activity sync
    • Compliance controls
    • Monitoring integration

Monitoring & Compliance

keep/observability/dashboards/servicenow_sync.json

  • Monitoring metrics:
    • Operations per minute
    • P95 latency
    • Error rates
    • API quota usage

Compliance/Audit Implementation

  • Added ServiceNowCompliance class:
    • Data retention enforcement
    • Encryption validation
    • Audit logging verification
  • Implemented ServiceNowAuditLogger:
    • Sync metadata recording
    • Immutable logging
    • SIEM integration

Shashwat-srivastav avatar Feb 23 '25 12:02 Shashwat-srivastav

@Shashwat-srivastav , I'm sorry but this seems AI-generated and violating design patterns the system follows. I hope you don't mind if I un-assign.

Matvey-Kuk avatar Mar 16 '25 13:03 Matvey-Kuk

/attempt #3379 Can I try this?

Options

MayorChristopher avatar Mar 31 '25 22:03 MayorChristopher

/attempt #3379

can i try

Abhishek-Atole avatar Apr 06 '25 16:04 Abhishek-Atole