Вопрос

I am having trouble working with getting appropriate response from atlassian-connect webhook. See below my descriptor file.

<?xml version="1.0" ?>
<atlassian-plugin key="com.atlas.local.ift" name="Sample Only" plugins-version="2">

    <plugin-info>
        <description>blah blah blah blah.</description>
        <version>1.0</version>
        <vendor name="Vendor" url="http://www.example.com" />

        <permissions>
            <permission>browse_projects</permission>
            <permission>store_data</permission>
            <permission>create_oauth_link</permission>
            <permission>intercept_requests</permission>
            <permission>read_users_and_groups</permission>
            <permission>read_user_session_data</permission>
        </permissions>
    </plugin-info>

    <remote-plugin-container key="container" display-url="http://local.atlas">
        <oauth>
            <public-key>            
                -----BEGIN PUBLIC KEY-----
                SomePublicKey...
                -----END PUBLIC KEY-----
            </public-key>
        </oauth>
    </remote-plugin-container>

    <general-page key="general" name="Sample plugin" url="/" height="2400">
        <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition" />
    </general-page>

    <webhook key="installed" event="remote_plugin_installed" url="/listen.php" />
    <webhook key="enabled" event="remote_plugin_enabled" url="/listen.php" />
    <webhook key="jira:issue_updated" event="jira:issue_updated" url="/listen.php" />
</atlassian-plugin>

The weird thing is that the only response I get is only the "user_id" field. Is this normal? Or did I made some errors within my descriptor file?

By the way, I am running a development/testing on-premise instance.

Это было полезно?

Решение

After solid hours of investigation I found out that it is with the data that I get from them. I am using PHP as my language and have the following calls to catch the data I can get from the webhook:

  1. $_POST - only returns user_id
  2. $_REQUEST - only returns user_id

However when I tried this:

file_get_contents('php://input');

I got what I want and expected.

It is with the HTTP_RAW_DATA that even the global $_REQUEST variable cannot retrieve.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top