Inserting remarks into Jira tickets via PHP SOAP

Hey everyone,

I’m working on a project where I need to add comments to Jira tickets automatically. I’m using PHP and want to do this through SOAP. Can anyone give me a hand with this?

I’ve looked at the Jira API docs, but I’m still a bit confused about how to set it up correctly. Has anyone done something similar before? Maybe you could share a code snippet or point me in the right direction?

I’m pretty new to working with SOAP in PHP, so any advice would be really helpful. Thanks in advance for your help!

I’ve actually implemented something similar in a project recently. One thing I found really helpful was using the Jira PHP SOAP Client library. It wraps a lot of the complexity of working directly with SOAP.

To add comments, you’d typically do something like:

$jira = new JiraClient($jiraUrl, $username, $password);
$jira->addComment($issueKey, $commentText);

Make sure you have proper error handling in place. SOAP can be finicky, especially with authentication.

Also, keep in mind that Atlassian is deprecating their SOAP API. If you’re starting a new project, you might want to consider using their REST API instead. It’s more modern and has better documentation.

Hope this helps point you in the right direction!

hey there! i’ve worked with jira api before, but not through SOAP. have you considered using REST instead? its usually easier to work with. if you’re set on SOAP tho, you might wanna check out the PHP SoapClient class. it can handle a lot of the heavy lifting for ya. good luck with ur project!

While I haven’t used SOAP with Jira specifically, I can offer some general advice. First, ensure you have the WSDL (Web Services Description Language) file for Jira’s SOAP API. You’ll need this to initialize the SoapClient in PHP. Then, you’ll want to authenticate your requests, typically using username and password or API token. For adding comments, look for a method like ‘addComment’ in the API documentation. You’ll likely need to pass the issue key and comment text as parameters. Remember to handle exceptions, as SOAP operations can sometimes be finicky. If you’re still struggling, consider switching to REST as others have suggested - it’s generally more straightforward to implement.