Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error pulling project tickets since CW Update #134

Open
justinDJC opened this issue Jun 5, 2019 · 10 comments
Open

Error pulling project tickets since CW Update #134

justinDJC opened this issue Jun 5, 2019 · 10 comments
Assignees
Labels

Comments

@justinDJC
Copy link

Hiya!

Fantastic script, very useful.

having some issues since updating to 2019.3, specifically with /t command on our project tickets. Normal tickets work fine.

Notice: Undefined property: stdClass::$_info in [removed]/cw-slack/cwslack.php on line 749

Notice: Trying to get property of non-object in [removed]/cw-slack/cwslack.php on line 749
malformed

Is the result we get. Enabling debug mode, the output is:

string(1070) "HTTP/1.1 404 Not Found
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 67
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
x-server-name: SERVER2012
x-cw-request-id: 7afd5c02-98d1-44e2-96b5-972e3b6182b5
api-current-version: 2019.3
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: .connectwise .connectwise.com .appcues.com az416426.vo.msecnd.net dc.services.visualstudio.com/v2/track .appcues.net .connectwisedev.com .myconnectwise.net cwview.com .wise-pay.com .wise-sync.com; font-src 'self' 'unsafe-inline' 'unsafe-eval' .connectwise.com .googleapis.com; img-src * data: snapshot:; frame-src * data:; connect-src 'self' .connectwise.com .connectwisedev.com .myconnectwise.net cwview.com .appcues.net wss://.appcues.net cheetah quotewerks://;
Date: Wed, 05 Jun 2019 06:25:23 GMT

{
"code": "NotFound",
"message": "Ticket 457671 not found"
}"
string(1592) "HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 587
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
x-server-name: SERVER2012
x-cw-request-id: ae6304ee-40b0-46f2-9502-12fccc25fdfa
Link:
api-current-version: 2019.3
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: .connectwise .connectwise.com .appcues.com az416426.vo.msecnd.net dc.services.visualstudio.com/v2/track .appcues.net .connectwisedev.com .myconnectwise.net cwview.com .wise-pay.com .wise-sync.com; font-src 'self' 'unsafe-inline' 'unsafe-eval' .connectwise.com .googleapis.com; img-src * data: snapshot:; frame-src * data:; connect-src 'self' .connectwise.com .connectwisedev.com .myconnectwise.net cwview.com .appcues.net wss://.appcues.net cheetah quotewerks://;
Date: Wed, 05 Jun 2019 06:25:23 GMT

[{"id":699415,"ticketId":457671,"text":"Assigned / je / Assigning ticket","detailDescriptionFlag":false,"internalAnalysisFlag":true,"resolutionFlag":false,"member":{"id":174,"identifier":"PM","name":"DJC Project Manager","_info":{"member_href":"https://portal.djc.com.au/v4_6_release/apis/3.0/system/members/174","image_href":"https://portal.djc.com.au/v4_6_release/apis/3.0/system/members/174/image?lm=2018-11-13T00:33:23Z"}},"dateCreated":"2019-05-23T03:55:12Z","createdBy":"PM","internalFlag":true,"externalFlag":false,"_info":{"lastUpdated":"2019-05-23T03:55:12Z","updatedBy":"PM"}}]"
string(1081) "HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 76
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
x-server-name: SERVER2012
x-cw-request-id: f43a4418-cfb9-451f-a9a2-abf188da47e6
api-current-version: 2019.3
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: .connectwise .connectwise.com .appcues.com az416426.vo.msecnd.net dc.services.visualstudio.com/v2/track .appcues.net .connectwisedev.com .myconnectwise.net cwview.com .wise-pay.com .wise-sync.com; font-src 'self' 'unsafe-inline' 'unsafe-eval' .connectwise.com .googleapis.com; img-src * data: snapshot:; frame-src * data:; connect-src 'self' .connectwise.com .connectwisedev.com .myconnectwise.net cwview.com .appcues.net wss://.appcues.net cheetah quotewerks://;
Date: Wed, 05 Jun 2019 06:25:23 GMT

{
"code": "InvalidOrderBy",
"message": "Unrecognized orderBy field"
}"

Notice: Undefined property: stdClass::$_info in [removed]/cw-slack/cwslack.php on line 749

Notice: Trying to get property of non-object in [removed]/cw-slack/cwslack.php on line 749
bool(false)
malformed

Any help would be appreciated.

@justinDJC
Copy link
Author

Further to the above.

I've found that in the API logs, it looks like its trying to look up the ticket as though it was a service ticket, but the API needs to be looking at in in the project area. Perhaps they made changes to the API?

404 (NotFound) GET https://portal.djc.com.au/v4_6_release/apis/3.0/service/tickets/473050

If i log in in by browser and change service to project, i get data.

@kenoyer130
Copy link

kenoyer130 commented Jun 21, 2019 via email

@jundis
Copy link
Owner

jundis commented Jul 8, 2019

@justinDJC Sorry for the delay on this, I should have a patch in for this sometime this week or next week.

@justinDJC
Copy link
Author

Legend. Thanks mate.

@jundis
Copy link
Owner

jundis commented Jul 29, 2019

@justinDJC Still delayed. We're stuck on 2019.1 currently due to our server still being 2008r2. Currently working to figure out a migration plan with CW, and once that's done I'll have an update in for this.

@justinDJC
Copy link
Author

No stress at all mate. Thanks for the update :)

@jundis
Copy link
Owner

jundis commented Oct 21, 2019

We're finally on it. I'll have an update for this sometime this week, sorry for the delays.

@jundis
Copy link
Owner

jundis commented Oct 21, 2019

@justinDJC Bit of an idiot and could've had this workaround for you a while ago, sorry. If you set functions.php to have $globalVersion = "2019.2"; on line 29 instead of 2019.3, it should work while I make a patch.

@justinDJC
Copy link
Author

Hi Mate!

No stress at all. I gave your quick fix a go and the error changed to:

Notice: Undefined property: stdClass::$dateEntered in -------/cw-slack/cwslack.php on line 776

Line 776 is: $date=strtotime($dataTData->_info->dateEntered); //Convert date entered JSON result to time.

I'll await your update :)

@jundis jundis self-assigned this Oct 22, 2019
jundis added a commit that referenced this issue Oct 22, 2019
@jundis
Copy link
Owner

jundis commented Oct 22, 2019

@justinDJC Updated files should correct those issues. Replace the main cwslack file, incoming, timealerts, and time. I also updated functions to correctly say 2019.2 for API version

@jundis jundis added the bug label Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants