Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
eaee30a5
Commit
eaee30a5
authored
4 years ago
by
Sebastian Listl
Browse files
Options
Downloads
Patches
Plain Diff
mstBot_rest webservice
parent
11227a0d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/mstBot_rest/process.js
+22
-10
22 additions, 10 deletions
process/mstBot_rest/process.js
with
22 additions
and
10 deletions
process/mstBot_rest/process.js
+
22
−
10
View file @
eaee30a5
import
(
"
system.datetime
"
);
import
(
"
system.teams
"
);
import
(
"
system.logging
"
);
import
(
"
system.text
"
);
import
(
"
system.util
"
);
import
(
"
Sql_lib
"
);
import
(
"
KeywordRegistry_basic
"
);
import
(
"
Date_lib
"
);
function
restpost
(
pRequestAsJson
)
{
...
...
@@ -54,11 +57,11 @@ function restpost(pRequestAsJson)
var
plainMessage
=
text
.
html2text
(
pHTML
);
var
splitM
essage
=
plainMessage
.
split
(
"
/
"
);
if
(
splitM
essage
.
length
!==
2
)
var
m
essage
Parts
=
plainMessage
.
split
(
"
/
"
);
if
(
m
essage
Parts
.
length
!==
2
)
return
pRequestAsJson
;
var
command
=
splitM
essage
[
1
].
split
(
/
\s
+
?
/
);
var
command
=
m
essage
Parts
[
1
].
split
(
/
\s
+
?
/
);
var
parameters
=
{};
command
.
slice
(
1
).
forEach
(
function
(
param
)
{
...
...
@@ -69,14 +72,23 @@ function restpost(pRequestAsJson)
});
command
=
command
[
0
];
switch
(
command
)
if
(
command
==
"
addTask
"
&&
parameters
.
editor
&&
parameters
.
subject
)
{
case
"
addTask
"
:
var
fieldValues
=
{};
if
(
"
editor
"
in
parameters
)
//TODO: insert task
var
currentDate
=
datetime
.
date
();
var
fieldValues
=
{
"
KIND
"
:
$KeywordRegistry
.
taskType
$task
(),
"
START_DATE
"
:
currentDate
,
"
MATURITY_DATE
"
:
Duration
.
ofDays
(
7
).
getDateWithDurationAdded
(
currentDate
).
getTime
(),
"
PRIORITY
"
:
$KeywordRegistry
.
taskPriority
$low
(),
"
STATUS
"
:
$KeywordRegistry
.
taskStatus
$new
(),
"
SUBJECT
"
:
parameters
.
subject
,
"
REQUESTOR_CONTACT_ID
"
:
""
,
"
PROGRESS
"
:
$KeywordRegistry
.
taskProgress
$0
()
};
if
(
"
editor
"
in
parameters
)
fieldValues
[
"
EDITOR_CONTACT_ID
"
]
=
""
;
//TODO: find out contactid
new
SqlBuilder
.
insertFields
(
fieldValues
,
"
TASK
"
,
"
TASKID
"
);
}
return
pRequestAsJson
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment