Raise jira project access request from confulence using confiform
Asked by Brijendra Singh:

I have confiforms page where jira is getting created by users after submitting the requested details but before I want to put one validation section where user can test his access whether he/she have access on this jira project or not if not then a action button apear and submit the access request which will be notified by IFTTT send mail.

I'm not sure how I can validate the user for access and post validation how button will appear for submit the request , all I want to a achive using confiform or is there any way to achieve it.

Thanks in advance!!


Answers:
author: Alex Medved _ConfiForms_
body: Hi

You can try to set up a rule that will run on form load that attempts to look up and set some specific Jira to one of the hidden fields issue <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-LookupandsetJIRAissuedata>

And if that fails to set (the field remains empty) then you can assume the lookup has failed and the user has no access to Jira

Alex

comments: author: Brijendra Singh
body: But I have unknown user if I do the same where I have given jira project key as "Abcd1234" now under this whatever jira is there if that user is having as reportee for any Jira then test is pass or else on condition request raise button should aper I have already ise IFTTT to send mail for access.

I did as you suggested but it's not giving any output


author: Alex Medved _ConfiForms_
body: Sorry, I dont quite understand your comment.


author: Brijendra Singh
body: I have jira project which has the key value - CTXHKKK and when any new jira raised user that project Jira ref no will be CTXHKKK-561.

Now I have created a confiforms forms - acces check and request .

Where I have two field - where one value will be the project key ( CTXHKKK) which will be static and other confiform field will be accept the User ID ( USERID is our corporate id which is require to login any internal app and same id is getting stamped as reportee/assingee in Jira).

Now when user will give user ID as input, confiform rule defination in the backend will search for jira for given userid as reportee there , if its sucess msg you will shown as "you have access" please proceed with the next and if not then it give msg to user as you did not have access and IFTTT confiform will intiate a mail for access request .


author: Brijendra Singh
body: [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) could you please help


author: Alex Medved _ConfiForms_
body: Hi

Take a look at this demo (as much as I can understand your requirements) - hope it helps

<http://recordit.co/JIbh2klUv0>

Configuration as a page storage format

```

<ac:structured-macro ac:macro-id="cc9bddf6-cb7e-4ff8-896c-51b920fb655e" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="518e3220-c89d-4bd2-a99f-39cb99845927" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="registrationButtonLabel">Request access</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="c8e5b1ea-fad6-4cd7-b32a-d35d97994183" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ticket</ac:parameter>
<ac:parameter ac:name="fieldLabel">ticket</ac:parameter>
<ac:parameter ac:name="type">read_only</ac:parameter>
</ac:structured-macro> ? made this RO so you can see (but in real form it can be hidden)</p>
<p>
<ac:structured-macro ac:macro-id="6795d21b-1486-45fc-abb5-9378ad0b9bee" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">id:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">ticket=[entry.issues.key]</ac:parameter>
<ac:parameter ac:name="values">/rest/api/2/search?jql=project=TEST%20AND%20reporter=[entry._user]&amp;maxResults=1&amp;fields=key</ac:parameter>
<ac:parameter ac:name="action">Lookup and set WS value</ac:parameter>
<ac:parameter ac:name="values2">cfba30fa2e0a3032da59e572b2560bd7</ac:parameter>
</ac:structured-macro>?</p>
<p>
<ac:structured-macro ac:macro-id="68194df4-dcfa-4810-b358-2b21a05c4ec7" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!ticket:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">Looks like you already have requested an access to Jira, reference ticket is: [entry.ticket]</ac:parameter>
<ac:parameter ac:name="action">Validation rule</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
```

Alex


author: Brijendra Singh
body: We don't have web services configured due to restrictions.

Is there any other way to do that !


author: Brijendra Singh
body: Any further advice [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)


author: Alex Medved _ConfiForms_
body: Not sure what further advice are you looking for... your requirement is to do a web service request to check the data in Jira... and you are saying you cannot use the web-service request because of the restrictions

Something contradicts with each other

Alex


author: Brijendra Singh
body: I'm sorry but I have not asked for web services request as I was not even sure If that can.be handle with that after given your solution I did try and with that and found out we did not have Webservices request due to restrictions.

We do creating Jira from confiforms using IFTTT.

I thought there will be other way to do it as we should not have only one way to achive something.


Tags: confiforms

confluence-server

server