As you know, Confiforms doesn't support automation jobs and scheduling, while Adaptavist Scriptrunner plugin support jobs with custom scripts.
I have a form with auto enroll option and I want to submit it daily. The form check a criteria and when it is right, it sends an email.
I try lots of scripts to load enroll url, but I couldn't succeed. The url sample is like this:
"/confiforms/autoenroll.action?pageId=xxxx&f=FormName&_redirectUrl=/"
Could anyone help me to do this? Also please first test it, because I tried lots of scripts and none of them has worked.
Also my instance is restricted and it requires authentication to submit the form.
Is there another way I implement scheduling on Confiforms?
Hi @Amir and welcome to this community
Using autoenroll URL to submit a form in ConfiForms sounds a but unusual.
There are REST APIs you can use - https://wiki.vertuna.com/display/CONFIFORMS/REST+API
which allow you full flexibility at what you do and how
Alex
Hi Alex
Thank you for you answer.
How can I schedule Confiforms IFTTT with Rest API?
I want Confiforms check a condition (ex. a date) everyday and if it is true, send an email.
Thanks
Amir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Amir
I guess the answer is the topic title :-)
(or any other 3rd party scheduler you can use - CRON, etc)
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wrote this code in "Jobs" section of ScriptRunner and chose "Confluence Admin" in "Run as" field, But I got 401 error!
import groovy.json.JsonOutput
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
import org.apache.http.entity.ContentType
def payload = [
fields: [
"mytextfield"
:
"field value"
]
]
def http = new HTTPBuilder("https://<my-confluence-site>")
http.request(Method.POST, ContentType.APPLICATION_JSON) {
uri.path = '/rest/confiforms/1.0/create/pageId/formName'
headers.'Content-Type' = 'application/json'
requestEntity = JsonOutput.toJson(payload)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
401 means your request is not authenticated
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I know. But there isn't any reason why I get this error. Because I run this script (and create confiforms entry) as Confluence Admin! So maybe the code is wrong and it should be changed...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the http connection you open to confluence does not seems to be authenticated
(but I am not a scriptrunner user, so I might be wrong)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.