Script job count is incorrect #8991

Closed
opened 2025-12-29 20:43:55 +01:00 by adam · 1 comment
Owner

Originally created by @DanSheps on GitHub (Dec 20, 2023).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.6.7

Python Version

3.10

Steps to Reproduce

  1. Create a script file:
from extras.scripts import Script


class TestScript(Script):
    name = 'Test'
    description = ''

    def run(self, data, commit=True):
        self.log_success('Finished Script')


class TestScriptNew(Script):
    name = 'Test New'
    description = ''

    def run(self, data, commit=True):
        self.log_success('Finished Script 2')
  1. Upload to NetBox
  2. Run Test
  3. View Test New

Expected Behavior

Job tab badge has "0"

Observed Behavior

Job tab badge has >0

Originally created by @DanSheps on GitHub (Dec 20, 2023). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.6.7 ### Python Version 3.10 ### Steps to Reproduce 1. Create a script file: ```python from extras.scripts import Script class TestScript(Script): name = 'Test' description = '' def run(self, data, commit=True): self.log_success('Finished Script') class TestScriptNew(Script): name = 'Test New' description = '' def run(self, data, commit=True): self.log_success('Finished Script 2') ``` 2. Upload to NetBox 3. Run `Test` 5. View `Test New` ### Expected Behavior Job tab badge has "0" ### Observed Behavior Job tab badge has >0
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:43:55 +01:00
adam closed this issue 2025-12-29 20:43:55 +01:00
Author
Owner

@DanSheps commented on GitHub (Dec 20, 2023):

This is caused by the badge querying module.jobs without filtering for the script name.

@DanSheps commented on GitHub (Dec 20, 2023): This is caused by the badge querying `module.jobs` without filtering for the script name.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8991