Webservice Function provides data no output to HTTP Request

Open
#248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

The issue provides a trigger configuration using webservice_action_step followed by http_post_action_step, but names no source files or tests. Start by tracing how the webservice step returns data and how the HTTP request step resolves {data} in the request body. Reproduce the supplied configuration and determine whether the response data reaches the webhook; done means the expected cohort data is available there or the configuration needed to expose it is clear.

Written by the indexing model from the issue text.

Description

I am using a webservice function to provide more data on a cohort when created to the http request step but I have tried to add the data from the webservice function with no data showing up to the webhook, all I see is the filtercode for the data which I have set up as {data} in the body.

here is the json file:
{"name":"Corhort Created","description":"{"text":"","format":"1"}","event":"\core\event\cohort_created","debug":"1","steps":{"58":{"id":"58","name":"Get Cohort Info","description":"Get Cohort Info","type":"actions","stepclass":"\tool_trigger\steps\actions\webservice_action_step","data":"{"functionname":"core_cohort_get_cohorts","username":"","params":"{\r\n \"cohortids\": [{objectid}]\r\n}","stepdesc":"Webservice Function","typedesc":"Action"}","steporder":"0"},"59":{"id":"59","name":"Send to N8N","description":"Send to N8N","type":"actions","stepclass":"\tool_trigger\steps\actions\http_post_action_step","data":"{"url":"https:\/\/n8nurl\/webhook-test\/cohort-created","httpmethod":"POST","httpheaders":"Content-Type: application\/json\r\nAccept: application\/json","httpparams":"cohortid={objectid}&cohortdata{data}","jsonencode":"1","expectedresponse":"200","stepdesc":"HTTP request","typedesc":"Action"}","steporder":"1"}},"moodleversion":"2025041402","pluginversion":"2024111900"}

I would like to use your filtering ability but I never can get that to work.

Dominant language
PHP
Stars
46
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from catalyst/moodle-tool_trigger

All issues in catalyst/moodle-tool_trigger

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.