【问题标题】:Update Task Project Online using JQuery & Rest API使用 JQuery 和 Rest API 更新 Task Project Online
【发布时间】:2017-03-17 00:47:55
【问题描述】:

我的 JSON 字符串包含我要更新的参数

var oCreateTaskParameter = JSON.stringify
(
 {
  "parameters":
     {   
       "Custom_x005f_5ef4c0a0aaa1e61180cc00155d302506": "Testing"
     }
 }
);

下面是我的 Ajax 查询

$.ajax({
url:'<<site url>>/sites/pwa/_api/ProjectServer/Projects(<<guid>>)/Draft/Tasks/GetById(<<guid>>)',
type: "POST",
 contentType: "application/json;odata=verbose",
    data: oCreateTaskParameter,
   headers: {
             "accept": "application/json;odata=verbose",
             "content-type": "application/json;odata=verbose",
             "X-RequestDigest": '<<Request Digest>>'
            },
 success:function(data){

},
error:function(data){
console.log(data);
},
async:false
});

但我得到一个错误 “GetById 方法中不存在参数参数”

我正在发送参数参数,谁能告诉我我在这里做错了什么?

【问题讨论】:

    标签: ms-project project-server project-online


    【解决方案1】:

    您使用的端点似乎只支持 GET(如 here 所述),并且只会检索 DraftTask 的内容。我想你会想在这个 URL 中使用 MERGE 动词:

    http://<sitecollection>/<site>/_api/ProjectServer/Projects('projectid')/Draft/Tasks('taskid')
    

    文档是here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-23
      • 1970-01-01
      • 2016-09-04
      • 2019-06-11
      • 2020-02-02
      • 1970-01-01
      • 2012-11-01
      • 2021-07-20
      相关资源
      最近更新 更多