As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

/rest/scheduledEmailReport/{scheduledEmailReportId}/edit


Descriptor

Value

HTTP Method

PUT

Description

Edits an existing scheduled email report's basic fields.

Required Permission

Manage Email Reports (Global level)

Version Introduced2.7.4


Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

A value of ‘application/json’ must be provided.


Request PUT Data Parameters

Parameter

Value

Required

Description

teamIds

Integer

Yes

The ID for the teams to set for the report.  At least one team must be specified.  See the example below to see how to pass in multiple teams.

This parameter is not additive; if you wish to add a new team to the report's existing list of teams, you must provide all of the old team IDs as parameters as well.

severity

String

Yes

The name of the severity for the report's severity threshold.  If you have customized your ThreadFix severity names, use your custom names.

schedulingMethodStringNoWhich type of schedule you will define.  Must be either "SELECT" or "CRON", case-insenstive, but will default to "SELECT" if not specified.
frequencyStringYes*

*Required if using "SELECT" schedulingMethod.

Must be either "Weekly" or "Daily", case-insenstive.  Determines whether schedule will be every day or only on a specified day of the week.

dayStringYes*

*Required if using "SELECT" schedulingMethod and a "Weekly" frequency.

The day of the week the report will execute.  Must be the full name of the day of the week, for example: "Wednesday".

hourIntegerYes*

*Required if using "SELECT" schedulingMethod.

The hour (1-12) for the time the report will execute.

minuteIntegerYes*

*Required if using "SELECT" schedulingMethod.

The minute the report will execute.  Must be one of: 0, 15, 30, 45.  If you need to specify a more specific minute place, please use a cron expression to define your schedule.

periodStringYes*

*Required if using "SELECT" schedulingMethod.

Must be either "AM" or "PM", for the time the report will execute.

cronExpressionStringYes*

*Required if using "CRON" schedulingMethod.

The Cron expression for the time the schedule will execute.  Cron Expressions in ThreadFix do not accept a "seconds" place, so please omit that from your string.  The "year" is also optional.  For example, to run a schedule every day at 9:13 AM, you would provide "13 9 * * ?".


Sample Call:

Editing a scheduled email report to only be attached to 1 team, with a severity threshold of "low", and using a cron expression to run the schedule every day at 6 AM:

curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X PUT --data "teamIds=1&severity=low&schedulingMethod=cron&cronExpression=0 6 * * ?" http://localhost:8080/threadfix/rest/latest/scheduledEmailReport/19/edit


Editing the above scheduled email report to add another team, change the severity threshold to "elevated" (a custom severity name), and use the select method to set the schedule to 1:30 PM every Monday:

curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X PUT --data "teamIds=1&teamIds=2&severity=elevated&schedulingMethod=select&frequency=weekly&day=monday&hour=1&minute=30&period=pm" http://localhost:8080/threadfix/rest/latest/scheduledEmailReport/19/edit

Sample Output:


{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": 19,
        "hour": 0,
        "minute": 0,
        "period": "",
        "day": "",
        "frequency": "",
        "scheduleType": "CRON",
        "cronExpression": "0 6 * * ?",
        "severityLevel": {
            "id": 1,
            "name": "High",
            "intValue": 4,
            "displayName": "High"
        },
        "emailLists": [],
        "emailAddresses": [],
        "organizations": [
            {
                "id": 2,
                "name": "Extra"
            },
            {
                "id": 1,
                "name": "Test"
            }
        ],
        "scheduledDate": "at 06:00",
        "cronTranslation": "at 06:00"
    }
}

  • No labels